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