Dockerfile.client 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. #syntax=docker/dockerfile:1.2@sha256:e2a8561e419ab1ba6b2fe6cbdf49fd92b95912df1cf7d313c3e2230a333fdbcc
  2. FROM cli-gen AS cli-export
  3. FROM const-gen AS const-export
  4. FROM ghcr.io/wormhole-foundation/solana:1.10.31@sha256:d31e8db926a1d3fbaa9d9211d9979023692614b7b64912651aba0383e8c01bad AS solana
  5. RUN apt-get update
  6. # libudev is needed by spl-token-cli, and ncat is needed by the devnet setup
  7. # script to be able to signal a health status for tilt
  8. RUN apt-get install -y libudev-dev ncat ca-certificates curl gnupg
  9. RUN mkdir -p /etc/apt/keyrings
  10. RUN curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg
  11. ARG NODE_MAJOR=18
  12. RUN echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_$NODE_MAJOR.x nodistro main" | tee /etc/apt/sources.list.d/nodesource.list
  13. RUN apt-get update
  14. RUN apt-get install nodejs -y
  15. RUN --mount=type=cache,target=/root/.cache \
  16. cargo install --version =2.0.12 --locked spl-token-cli
  17. COPY solana /usr/src/solana
  18. COPY proto /usr/src/proto
  19. WORKDIR /usr/src/solana
  20. RUN solana config set --keypair "/usr/src/solana/keys/solana-devnet.json"
  21. RUN solana config set --url "http://solana-devnet:8899"
  22. ENV EMITTER_ADDRESS="11111111111111111111111111111115"
  23. ENV BRIDGE_ADDRESS="Bridge1p5gheXUvJ6jGWGeCsgPKgnE3YgdGKRVCMY9o"
  24. RUN --mount=type=cache,target=/root/.cache \
  25. --mount=type=cache,target=target \
  26. --mount=type=cache,target=/usr/local/cargo/registry,id=cargo_registry \
  27. set -xe && \
  28. cargo build --manifest-path ./Cargo.toml --package bridge_client --release --locked && \
  29. cargo build --manifest-path ./Cargo.toml --package token_bridge_client --release --locked && \
  30. cp target/release/bridge_client /usr/local/bin/client && \
  31. cp target/release/token_bridge_client /usr/local/bin/token-bridge-client
  32. # Copy .env and CLI and link `worm`
  33. COPY --from=const-export .env /usr/src/solana/.env
  34. COPY --from=cli-export clients/js /usr/src/cli
  35. WORKDIR /usr/src/cli
  36. RUN npm link