Dockerfile 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. #
  2. # Docker image to generate deterministic, verifiable builds of Anchor programs.
  3. # This must be run *after* a given ANCHOR_CLI version is published and a git tag
  4. # is released on GitHub.
  5. #
  6. FROM ubuntu:18.04
  7. ARG DEBIAN_FRONTEND=noninteractive
  8. ARG SOLANA_CLI
  9. ARG ANCHOR_CLI
  10. ENV HOME="/root"
  11. ENV PATH="${HOME}/.cargo/bin:${PATH}"
  12. ENV PATH="${HOME}/.local/share/solana/install/active_release/bin:${PATH}"
  13. # Install base utilities.
  14. RUN mkdir -p /workdir && mkdir -p /tmp && \
  15. apt-get update -qq && apt-get upgrade -qq && apt-get install -qq \
  16. build-essential git curl wget jq pkg-config python3-pip \
  17. libssl-dev libudev-dev
  18. # Install rust.
  19. RUN curl "https://sh.rustup.rs" -sfo rustup.sh && \
  20. sh rustup.sh -y && \
  21. rustup component add rustfmt clippy
  22. # Install Solana tools.
  23. RUN sh -c "$(curl -sSfL https://release.solana.com/${SOLANA_CLI}/install)"
  24. # Install anchor.
  25. RUN cargo install --git https://github.com/project-serum/anchor --tag ${ANCHOR_CLI} anchor-cli --locked
  26. # Build a dummy program to bootstrap the BPF SDK (doing this speeds up builds).
  27. RUN mkdir -p /tmp && cd tmp && anchor init dummy && cd dummy && anchor build
  28. WORKDIR /workdir