fix: mount apt cache as locked in docker buildkit (#571)

Co-authored-by: binarybaron <binarybaron@mail.mail>
This commit is contained in:
Mohan 2025-09-19 00:25:30 -05:00 committed by GitHub
parent b9948d7f00
commit a4cddf2815
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 6 additions and 7 deletions

View file

@ -10,9 +10,8 @@ FROM ubuntu:24.04@sha256:a08e551cb33850e4740772b38217fc1796a66da2506d312abe51acd
# See .github/actions/set-monero-env/action.yml for required dependencies # See .github/actions/set-monero-env/action.yml for required dependencies
# The `--mount` allows us to agressively cache this step. # The `--mount` allows us to agressively cache this step.
ENV DEBIAN_FRONTEND=noninteractive ENV DEBIAN_FRONTEND=noninteractive
RUN --mount=type=cache,target=/var/cache/apt \ RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \
--mount=type=cache,target=/var/lib/apt \ --mount=type=cache,target=/var/lib/apt,sharing=locked \ apt-get update && \
apt-get update && \
apt-get install -y --allow-change-held-packages \ apt-get install -y --allow-change-held-packages \
autoconf \ autoconf \
# Left out as we are not compiling for Windows in this Dockerfile # Left out as we are not compiling for Windows in this Dockerfile
@ -95,8 +94,8 @@ FROM ubuntu:24.04@sha256:a08e551cb33850e4740772b38217fc1796a66da2506d312abe51acd
# Install native root certificates # Install native root certificates
ENV DEBIAN_FRONTEND=noninteractive ENV DEBIAN_FRONTEND=noninteractive
RUN --mount=type=cache,target=/var/cache/apt \ RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \
--mount=type=cache,target=/var/lib/apt \ --mount=type=cache,target=/var/lib/apt,sharing=locked \
apt-get update && \ apt-get update && \
apt-get install -y ca-certificates && \ apt-get install -y ca-certificates && \
update-ca-certificates update-ca-certificates

View file

@ -14,8 +14,8 @@ FROM debian:bookworm@sha256:b6507e340c43553136f5078284c8c68d86ec8262b1724dde73c3
# Install native root certificates # Install native root certificates
ENV DEBIAN_FRONTEND=noninteractive ENV DEBIAN_FRONTEND=noninteractive
RUN --mount=type=cache,target=/var/cache/apt \ RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \
--mount=type=cache,target=/var/lib/apt \ --mount=type=cache,target=/var/lib/apt,sharing=locked \
apt-get update && \ apt-get update && \
apt-get install -y ca-certificates && \ apt-get install -y ca-certificates && \
update-ca-certificates update-ca-certificates