Dockerfile 975 B

12345678910111213141516171819202122232425262728293031
  1. FROM docker.io/golang:1.20.4@sha256:6dd5c5f8936d7d4487802fb10a77f31b1776740be0fc17ada1acb74ac958f7be AS build
  2. # Install OS packages
  3. RUN apt-get update && apt-get install --yes \
  4. build-essential curl clang libssl-dev protobuf-compiler
  5. # Install Rust
  6. RUN curl https://sh.rustup.rs -sSf | sh -s -- -y --quiet --no-modify-path
  7. ENV PATH="/root/.cargo/bin:${PATH}"
  8. # Install Solana
  9. RUN sh -c "$(curl -sSfL https://release.solana.com/v1.14.17/install)"
  10. ENV PATH="/root/.local/share/solana/install/active_release/bin:$PATH"
  11. # Set default toolchain
  12. RUN rustup default nightly-2023-07-23
  13. # Build
  14. WORKDIR /src
  15. COPY hermes hermes
  16. COPY pythnet/pythnet_sdk pythnet/pythnet_sdk
  17. WORKDIR /src/hermes
  18. RUN --mount=type=cache,target=/root/.cargo/registry cargo build --release
  19. FROM docker.io/golang:1.20.4@sha256:6dd5c5f8936d7d4487802fb10a77f31b1776740be0fc17ada1acb74ac958f7be
  20. # Copy artifacts from other images
  21. COPY --from=build /src/hermes/target/release/hermes /usr/local/bin/