12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849 |
- #
- # 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:22.04@sha256:1ec65b2719518e27d4d25f104d93f9fac60dc437f81452302406825c46fcc9cb
- ARG DEBIAN_FRONTEND=noninteractive
- ARG SOLANA_CLI
- ARG ANCHOR_CLI
- ARG NODE_VERSION="v20.18.0"
- ENV HOME="/root"
- ENV PATH="${HOME}/.cargo/bin:${PATH}"
- ENV PATH="${HOME}/.local/share/solana/install/active_release/bin:${PATH}"
- ENV PATH="${HOME}/.nvm/versions/node/${NODE_VERSION}/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 node / npm / yarn.
- RUN curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.11/install.sh | bash
- ENV NVM_DIR="${HOME}/.nvm"
- RUN . $NVM_DIR/nvm.sh && \
- nvm install ${NODE_VERSION} && \
- nvm use ${NODE_VERSION} && \
- nvm alias default node && \
- npm install -g yarn
- # Install Solana tools.
- RUN sh -c "$(curl -sSfL https://release.anza.xyz/${SOLANA_CLI}/install)"
- # Install anchor.
- RUN cargo install --git https://github.com/coral-xyz/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
|