|
| 1 | +## Dockerfile for devcontainer |
| 2 | + |
| 3 | +FROM mcr.microsoft.com/devcontainers/base:bookworm AS base |
| 4 | + |
| 5 | +ARG USER=vscode |
| 6 | +ARG GROUP=vscode |
| 7 | + |
| 8 | +ENV HOME="/home/${USER}" |
| 9 | +ENV PATH="$HOME/.cargo/bin:$PATH" |
| 10 | + |
| 11 | +# Install dependencies |
| 12 | +RUN apt-get update \ |
| 13 | + && apt-get -y install \ |
| 14 | + build-essential \ |
| 15 | + cmake \ |
| 16 | + curl \ |
| 17 | + gdb \ |
| 18 | + git \ |
| 19 | + gnupg \ |
| 20 | + lsb-release \ |
| 21 | + make \ |
| 22 | + pkg-config \ |
| 23 | + software-properties-common \ |
| 24 | + sudo \ |
| 25 | + wget \ |
| 26 | + musl-tools |
| 27 | + |
| 28 | +ARG LLVM_VERSION=18 |
| 29 | + |
| 30 | +# Install llvm |
| 31 | +RUN wget https://apt.llvm.org/llvm.sh \ |
| 32 | + && chmod +x ./llvm.sh \ |
| 33 | + && sudo ./llvm.sh ${LLVM_VERSION} clang clang-tools-extra \ |
| 34 | + && sudo ln -s /usr/lib/llvm-${LLVM_VERSION}/bin/ld.lld /usr/bin/ld.lld \ |
| 35 | + && sudo ln -s /usr/lib/llvm-${LLVM_VERSION}/bin/clang /usr/bin/clang |
| 36 | + |
| 37 | +# Install Node.js |
| 38 | +RUN curl -fsSL https://deb.nodesource.com/setup_22.x | bash - \ |
| 39 | + && apt-get install -y nodejs |
| 40 | + |
| 41 | +FROM base AS dev |
| 42 | + |
| 43 | +# Make sure the devcontainer user has sudo access |
| 44 | +RUN chown -R "${USER}:${GROUP}" /home/${USER} \ |
| 45 | + && echo "${USER} ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers |
| 46 | + |
| 47 | +# Persist bash history |
| 48 | +RUN SNIPPET="export PROMPT_COMMAND='history -a' && export HISTFILE=/commandhistory/.bash_history" \ |
| 49 | + && mkdir /commandhistory \ |
| 50 | + && touch /commandhistory/.bash_history \ |
| 51 | + && chown -R "${USER}" /commandhistory \ |
| 52 | + && echo "$SNIPPET" >> "/home/${USER}/.bashrc" |
| 53 | + |
| 54 | +USER $USER |
| 55 | + |
| 56 | +ARG RUST_TOOLCHAIN=1.89 |
| 57 | + |
| 58 | +# Install rust |
| 59 | +RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y \ |
| 60 | + && rustup default ${RUST_TOOLCHAIN} \ |
| 61 | + && rustup target add x86_64-unknown-linux-gnu \ |
| 62 | + && rustup target add x86_64-unknown-linux-musl \ |
| 63 | + && rustup target add x86_64-unknown-none \ |
| 64 | + && rustup target add wasm32-wasip1 \ |
| 65 | + && rustup toolchain add nightly-x86_64-unknown-linux-gnu \ |
| 66 | + && cargo install just \ |
| 67 | + && cargo install cargo-component \ |
| 68 | + && cargo install cargo-hyperlight \ |
| 69 | + && cargo install hyperlight-wasm-aot --locked --version 0.12.0 \ |
| 70 | + && cargo install wasmtime-cli --locked --version 36.0.6 |
0 commit comments