docker: Further optimize multi-layered build.

Signed-off-by: Jason Volk <jason@zemos.net>
This commit is contained in:
Jason Volk
2025-05-27 04:08:19 +00:00
parent 98bbf58121
commit 3ffc238799
7 changed files with 28 additions and 1 deletions

View File

@@ -8,6 +8,9 @@ ARG CARGO_TARGET
ARG rustup_version="1.28.1"
ARG rustup_components
WORKDIR /
COPY --link --from=input . .
WORKDIR /opt
RUN \
--mount=type=cache,dst=${RUSTUP_HOME},sharing=locked \
@@ -50,6 +53,9 @@ ARG CARGO_HOME
ARG CARGO_TARGET
ARG cargo_installs
WORKDIR /
COPY --link --from=input . .
RUN \
--mount=type=cache,dst=${RUSTUP_HOME},sharing=locked \
--mount=type=cache,dst=${CARGO_HOME},sharing=locked \