|
| 1 | +# syntax=docker/dockerfile:1 |
| 2 | +FROM mcr.microsoft.com/devcontainers/base:bookworm |
| 3 | + |
| 4 | +ARG USERNAME=vscode |
| 5 | + |
| 6 | +# ---- OS deps ---- |
| 7 | +RUN apt-get update && apt-get install -y --no-install-recommends \ |
| 8 | + build-essential \ |
| 9 | + pkg-config \ |
| 10 | + libssl-dev \ |
| 11 | + ca-certificates \ |
| 12 | + curl \ |
| 13 | + git \ |
| 14 | + unzip \ |
| 15 | + jq \ |
| 16 | + python3 \ |
| 17 | + python3-pip \ |
| 18 | + openssh-client \ |
| 19 | + && rm -rf /var/lib/apt/lists/* |
| 20 | + |
| 21 | +# ---- Rust toolchain ---- |
| 22 | +# Keep the install in the image so devcontainer startup is fast. |
| 23 | +RUN curl -sSf https://sh.rustup.rs | sh -s -- -y --profile minimal --default-toolchain stable |
| 24 | +ENV PATH="/root/.cargo/bin:${PATH}" |
| 25 | +RUN rustup component add rustfmt clippy |
| 26 | + |
| 27 | +# ---- Solana CLI (optional but convenient) ---- |
| 28 | +# Pin a version so builds are reproducible. |
| 29 | +ARG SOLANA_VERSION=1.18.22 |
| 30 | +RUN curl -sSfL https://release.solana.com/v${SOLANA_VERSION}/install | bash -s -- -u /usr/local/solana -s v${SOLANA_VERSION} |
| 31 | +ENV PATH="/usr/local/solana/active_release/bin:${PATH}" |
| 32 | + |
| 33 | +# ---- Anchor (optional) ---- |
| 34 | +# Anchor version pin is maintained by your repo; this just installs a recent stable anchor. |
| 35 | +# If you want strict pinning, set ANCHOR_VERSION. |
| 36 | +ARG ANCHOR_VERSION=0.30.1 |
| 37 | +RUN cargo install --locked anchor-cli --version ${ANCHOR_VERSION} || true |
| 38 | + |
| 39 | +# ---- Node (provided by devcontainer feature) ---- |
| 40 | +# Ensure npm is available and corepack is enabled. |
| 41 | +RUN corepack enable || true |
| 42 | + |
| 43 | +# ---- Non-root user ---- |
| 44 | +RUN usermod -aG sudo ${USERNAME} || true |
| 45 | + |
| 46 | +# ---- Workspace ---- |
| 47 | +WORKDIR /workspaces/signia |
0 commit comments