docker: Move rustup and cargo component lists into vars.

Signed-off-by: Jason Volk <jason@zemos.net>
This commit is contained in:
Jason Volk
2025-05-14 04:05:08 +00:00
parent 0463b962fd
commit 2b67de9fc3
2 changed files with 20 additions and 8 deletions

View File

@@ -6,6 +6,7 @@ ARG RUSTUP_HOME
ARG CARGO_HOME
ARG CARGO_TARGET
ARG rustup_version="1.28.1"
ARG rustup_components
WORKDIR /opt
RUN \
@@ -37,8 +38,7 @@ RUN \
rustup component add \
--toolchain ${rust_toolchain} \
--target ${CARGO_TARGET} \
clippy \
rustfmt \
${rustup_components} \
;
EOF
@@ -48,6 +48,7 @@ ARG rust_toolchain
ARG RUSTUP_HOME
ARG CARGO_HOME
ARG CARGO_TARGET
ARG cargo_installs
RUN \
--mount=type=cache,dst=${RUSTUP_HOME},sharing=locked \
@@ -58,11 +59,6 @@ RUN \
cargo install \
--locked \
--target ${CARGO_TARGET} \
cargo-chef \
cargo-audit \
cargo-deb \
cargo-arch \
cargo-generate-rpm \
lychee \
${cargo_installs} \
;
EOF