OXYGENHUB
# f2609cf795d8 oxygenflow / images / rust / Dockerfile
1.3 KiB · last changed Build image for Rust and Node jobs (images/rust: toolchain, rustfmt, clippy, Node 24, vendored crates, offline cargo); flow-init finds the program in the job's PATH (glibc's execvpe used PID 1's own); network "loopback" in M0 1 month ago source blame history raw
eb5c4db6 Andy McCall ↶ 1
# The OxygenFlow build image (backlog F1b): Rust with rustfmt and clippy,
2
# Node, and every crate the Oxygen projects use, vendored, because jobs
3
# have no network. Built by ./build.sh, which vendors the crates first.
4
FROM rust:1.97.1-slim-bookworm
5
6
RUN rustup component add rustfmt clippy \
7
 && apt-get update \
8
 && apt-get install -y --no-install-recommends ca-certificates xz-utils make git pkg-config \
9
 && rm -rf /var/lib/apt/lists/*
10
11
# The guest's PATH is fixed and has no /usr/local/cargo/bin, and a rustup
12
# proxy would need RUSTUP_HOME: link the toolchain's own binaries instead.
13
RUN tc=$(ls -d /usr/local/rustup/toolchains/*/ | head -1) \
14
 && for b in cargo rustc rustdoc cargo-fmt rustfmt cargo-clippy clippy-driver; do ln -sf "$tc/bin/$b" /usr/local/bin/$b; done
15
16
ARG NODE_VERSION
17
ARG NODE_SHA256
18
ADD https://nodejs.org/dist/v${NODE_VERSION}/node-v${NODE_VERSION}-linux-x64.tar.xz /tmp/node.tar.xz
19
RUN echo "${NODE_SHA256}  /tmp/node.tar.xz" | sha256sum -c - \
20
 && tar -xJf /tmp/node.tar.xz -C /usr/local --strip-components=1 --exclude='*/include' --exclude='*/share/doc' \
21
 && rm /tmp/node.tar.xz
22
23
# Cargo reads /.cargo/config.toml for anything under /, so /src uses the
24
# vendored crates; CARGO_HOME stays the default $HOME/.cargo (/tmp).
25
COPY vendor /opt/vendor
26
COPY cargo-config.toml /.cargo/config.toml