Skip to content

Commit

Permalink
build: Cache apt package data
Browse files Browse the repository at this point in the history
  • Loading branch information
JadedBlueEyes committed Jan 18, 2025
1 parent 7929261 commit a927b3d
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,11 +1,16 @@
FROM --platform=$BUILDPLATFORM docker.io/tonistiigi/xx AS xx
FROM --platform=$BUILDPLATFORM rust:1-slim-bookworm AS builder

# Don't delete the apt cache
RUN rm -f /etc/apt/apt.conf.d/docker-clean

# Install repo tools
# Line one: compiler tools
# Line two: curl, for downloading binaries
# Line three: for xx-verify
RUN apt-get update && apt-get install -y \
RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \
--mount=type=cache,target=/var/lib/apt,sharing=locked \
apt-get update && apt-get install -y \
clang lld pkg-config \
curl \
file
Expand All @@ -30,7 +35,9 @@ ARG TARGETPLATFORM
# xx-* are xx-specific meta-packages
# c is needed for ring
# cxx is needed for openssl
RUN xx-apt-get install -y \
RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \
--mount=type=cache,target=/var/lib/apt,sharing=locked \
xx-apt-get install -y \
xx-c-essentials xx-cxx-essentials \
libssl-dev

Expand Down

0 comments on commit a927b3d

Please sign in to comment.