Skip to content

Commit 89bcb9b

Browse files
feat: separate cache based on target to allow for more efficient caching
1 parent 37bd690 commit 89bcb9b

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

Dockerfile

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ FROM --platform=${BUILDPLATFORM} rust:1.89.0-trixie@sha256:6e6d04bd50cd4c433a805
33

44
ARG APPLICATION_NAME
55

6+
ENV DEBIAN_FRONTEND=noninteractive
7+
68
RUN rm -f /etc/apt/apt.conf.d/docker-clean \
79
&& echo 'Binary::apt::APT::Keep-Downloaded-Packages "true";' > /etc/apt/apt.conf.d/keep-cache
810

@@ -24,10 +26,12 @@ ARG TARGET=aarch64-unknown-linux-musl
2426

2527
FROM rust-${TARGETPLATFORM//\//-} AS rust-cargo-build
2628

29+
ENV DEBIAN_FRONTEND=noninteractive
30+
2731
COPY ./build-scripts /build-scripts
2832

29-
RUN --mount=type=cache,id=apt-cache,from=rust-base,target=/var/cache/apt,sharing=locked \
30-
--mount=type=cache,id=apt-lib,from=rust-base,target=/var/lib/apt,sharing=locked \
33+
RUN --mount=type=cache,id=apt-cache-${TARGET},from=rust-base,target=/var/cache/apt,sharing=locked \
34+
--mount=type=cache,id=apt-lib-${TARGET},from=rust-base,target=/var/lib/apt,sharing=locked \
3135
/build-scripts/setup-env.sh
3236

3337
RUN rustup target add ${TARGET}

0 commit comments

Comments
 (0)