docker: Move rustup and cargo component lists into vars.
Signed-off-by: Jason Volk <jason@zemos.net>
This commit is contained in:
@@ -6,6 +6,7 @@ ARG RUSTUP_HOME
|
|||||||
ARG CARGO_HOME
|
ARG CARGO_HOME
|
||||||
ARG CARGO_TARGET
|
ARG CARGO_TARGET
|
||||||
ARG rustup_version="1.28.1"
|
ARG rustup_version="1.28.1"
|
||||||
|
ARG rustup_components
|
||||||
|
|
||||||
WORKDIR /opt
|
WORKDIR /opt
|
||||||
RUN \
|
RUN \
|
||||||
@@ -37,8 +38,7 @@ RUN \
|
|||||||
rustup component add \
|
rustup component add \
|
||||||
--toolchain ${rust_toolchain} \
|
--toolchain ${rust_toolchain} \
|
||||||
--target ${CARGO_TARGET} \
|
--target ${CARGO_TARGET} \
|
||||||
clippy \
|
${rustup_components} \
|
||||||
rustfmt \
|
|
||||||
;
|
;
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
@@ -48,6 +48,7 @@ ARG rust_toolchain
|
|||||||
ARG RUSTUP_HOME
|
ARG RUSTUP_HOME
|
||||||
ARG CARGO_HOME
|
ARG CARGO_HOME
|
||||||
ARG CARGO_TARGET
|
ARG CARGO_TARGET
|
||||||
|
ARG cargo_installs
|
||||||
|
|
||||||
RUN \
|
RUN \
|
||||||
--mount=type=cache,dst=${RUSTUP_HOME},sharing=locked \
|
--mount=type=cache,dst=${RUSTUP_HOME},sharing=locked \
|
||||||
@@ -58,11 +59,6 @@ RUN \
|
|||||||
cargo install \
|
cargo install \
|
||||||
--locked \
|
--locked \
|
||||||
--target ${CARGO_TARGET} \
|
--target ${CARGO_TARGET} \
|
||||||
cargo-chef \
|
${cargo_installs} \
|
||||||
cargo-audit \
|
|
||||||
cargo-deb \
|
|
||||||
cargo-arch \
|
|
||||||
cargo-generate-rpm \
|
|
||||||
lychee \
|
|
||||||
;
|
;
|
||||||
EOF
|
EOF
|
||||||
|
|||||||
@@ -1279,6 +1279,20 @@ group "buildsys" {
|
|||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
rustup_components = [
|
||||||
|
"clippy",
|
||||||
|
"rustfmt",
|
||||||
|
]
|
||||||
|
|
||||||
|
cargo_installs = [
|
||||||
|
"cargo-chef",
|
||||||
|
"cargo-audit",
|
||||||
|
"cargo-deb",
|
||||||
|
"cargo-arch",
|
||||||
|
"cargo-generate-rpm",
|
||||||
|
"lychee",
|
||||||
|
]
|
||||||
|
|
||||||
#
|
#
|
||||||
# Rust build environment
|
# Rust build environment
|
||||||
#
|
#
|
||||||
@@ -1318,6 +1332,8 @@ target "cookware" {
|
|||||||
CARGO_HOME = "/opt/${sys_name}/${sys_target}/cargo"
|
CARGO_HOME = "/opt/${sys_name}/${sys_target}/cargo"
|
||||||
CARGO_TARGET = rust_target
|
CARGO_TARGET = rust_target
|
||||||
CARGO_TERM_VERBOSE = CARGO_TERM_VERBOSE
|
CARGO_TERM_VERBOSE = CARGO_TERM_VERBOSE
|
||||||
|
cargo_installs = join(" ", cargo_installs)
|
||||||
|
rustup_components = join(" ", rustup_components)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user