-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathDockerfile
49 lines (38 loc) · 1.47 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
FROM ubuntu:24.04
ARG DEBIAN_FRONTEND=noninteractive
ARG RUSTC_VERSION="v1.78.0"
ARG NODE_VERSION="v22.8.0"
ARG SOLANA_CLI="v1.17.25"
ARG ANCHOR_CLI="v0.29.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 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 --default-toolchain ${RUSTC_VERSION#v} -y && \
rustup component add rustfmt clippy
# Install node / npm / yarn.
RUN curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.40.1/install.sh | bash
ENV NVM_DIR="${HOME}/.nvm"
RUN . $NVM_DIR/nvm.sh && \
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 anchor init dummy && cd dummy && (anchor build || true)
RUN rm -r dummy
# Set up the working directory.
RUN mkdir /workdir
WORKDIR /workdir
# Copy the entrypoint script.
COPY entrypoint.sh /entrypoint.sh
RUN chmod +x /entrypoint.sh
# Define the entrypoint.
ENTRYPOINT ["/entrypoint.sh"]