Skip to content

Commit e0cf873

Browse files
Merge pull request #2095 from kristof-mattei/lock-cache
fix: lock fetch
2 parents 8959077 + cc62162 commit e0cf873

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

Dockerfile

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,11 @@
22
FROM --platform=${BUILDPLATFORM} rust:1.89.0-trixie@sha256:26318aeddc7e7335b55ab32f943ec2d400bcc024649f8dbdee569bfa85f0c11d AS rust-base
33

44
ARG APPLICATION_NAME
5+
ARG DEBIAN_FRONTEND=noninteractive
56

67
RUN rm -f /etc/apt/apt.conf.d/docker-clean \
78
&& echo 'Binary::apt::APT::Keep-Downloaded-Packages "true";' > /etc/apt/apt.conf.d/keep-cache
89

9-
ARG DEBIAN_FRONTEND=noninteractive
10-
1110
# borrowed (Ba Dum Tss!) from
1211
# https://github.com/pablodeymo/rust-musl-builder/blob/7a7ea3e909b1ef00c177d9eeac32d8c9d7d6a08c/Dockerfile#L48-L49
1312
RUN --mount=type=cache,id=apt-cache,target=/var/cache/apt,sharing=locked \
@@ -26,10 +25,10 @@ ARG TARGET=aarch64-unknown-linux-musl
2625

2726
FROM rust-${TARGETPLATFORM//\//-} AS rust-cargo-build
2827

29-
COPY ./build-scripts /build-scripts
30-
3128
ARG DEBIAN_FRONTEND=noninteractive
3229

30+
COPY ./build-scripts /build-scripts
31+
3332
RUN --mount=type=cache,id=apt-cache-${TARGET},from=rust-base,target=/var/cache/apt,sharing=locked \
3433
--mount=type=cache,id=apt-lib-${TARGET},from=rust-base,target=/var/lib/apt,sharing=locked \
3534
/build-scripts/setup-env.sh
@@ -54,8 +53,8 @@ COPY ./.cargo ./Cargo.toml ./Cargo.lock ./
5453
# both target platforms. It doesn't matter, as after unlocking the other one
5554
# just validates, but doesn't need to download anything
5655
RUN --mount=type=cache,id=cargo-git,target=/usr/local/cargo/git/db,sharing=locked \
57-
--mount=type=cache,id=cargo-registry-index,target=/usr/local/cargo/registry/index \
58-
--mount=type=cache,id=cargo-registry-cache,target=/usr/local/cargo/registry/cache \
56+
--mount=type=cache,id=cargo-registry-index,target=/usr/local/cargo/registry/index,sharing=locked \
57+
--mount=type=cache,id=cargo-registry-cache,target=/usr/local/cargo/registry/cache,sharing=locked \
5958
cargo fetch
6059

6160
RUN --mount=type=cache,target=/build/target/${TARGET},sharing=locked \

0 commit comments

Comments
 (0)