docker: Share the target deps and build caches globally.
Signed-off-by: Jason Volk <jason@zemos.net>
This commit is contained in:
@@ -7,6 +7,7 @@ ARG RUSTUP_HOME
|
||||
ARG CARGO_HOME
|
||||
ARG CARGO_TARGET
|
||||
ARG CARGO_TARGET_DIR
|
||||
ARG CARGO_TARGET_CACHE
|
||||
ARG cargo_profile
|
||||
ARG cargo_features
|
||||
ARG cargo_spec_features
|
||||
@@ -26,8 +27,10 @@ RUN \
|
||||
--mount=type=cache,dst=${RUSTUP_HOME},sharing=locked \
|
||||
--mount=type=cache,dst=${CARGO_HOME},sharing=locked \
|
||||
--mount=type=cache,dst=${CARGO_TARGET_DIR},sharing=locked \
|
||||
--mount=type=cache,dst=${CARGO_TARGET_DIR}/deps,sharing=shared \
|
||||
--mount=type=cache,dst=${CARGO_TARGET_DIR}/build,sharing=shared \
|
||||
--mount=type=cache,dst=${CARGO_TARGET_DIR}/deps,id=${CARGO_TARGET_CACHE}/deps,sharing=shared \
|
||||
--mount=type=cache,dst=${CARGO_TARGET_DIR}/build,id=${CARGO_TARGET_CACHE}/build,sharing=shared \
|
||||
--mount=type=cache,dst=${CARGO_TARGET_DIR}/incremental,id=${CARGO_TARGET_CACHE}/incremental,sharing=shared \
|
||||
--mount=type=cache,dst=${CARGO_TARGET_DIR}/.fingerprint,id=${CARGO_TARGET_CACHE}/fingerprint,sharing=shared \
|
||||
<<EOF
|
||||
set -eux
|
||||
case "$cargo_profile" in
|
||||
|
||||
Reference in New Issue
Block a user