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