Skip to content

Commit 24c3c67

Browse files
committed
refactor: use docker cache
1 parent 4051afc commit 24c3c67

File tree

2 files changed

+17
-17
lines changed

2 files changed

+17
-17
lines changed

.github/workflows/ci.yml

Lines changed: 7 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -132,20 +132,13 @@ jobs:
132132
- name: Inject var-cache-apt into docker
133133
uses: reproducible-containers/buildkit-cache-dance@5b6db76d1da5c8b307d5d2e0706d266521b710de # v3
134134
with:
135-
cache-source: var-cache-apt
136-
cache-target: /var/cache/apt
137-
138-
- name: Inject root-cache-pip into docker
139-
uses: reproducible-containers/buildkit-cache-dance@5b6db76d1da5c8b307d5d2e0706d266521b710de # v3
140-
with:
141-
cache-source: root-cache-pip
142-
cache-target: /root/.cache/pip
143-
144-
- name: Inject root-cache-uv into docker
145-
uses: reproducible-containers/buildkit-cache-dance@5b6db76d1da5c8b307d5d2e0706d266521b710de # v3
146-
with:
147-
cache-source: root-cache-uv
148-
cache-target: /root/.cache/uv
135+
cache-map: |
136+
{
137+
"var-cache-apt": "/var/cache/apt",
138+
"var-lib-apt": "/var/lib/apt",
139+
"root-cache-pip": "/root/.cache/pip",
140+
"root-cache-uv": "/root/.cache/uv",
141+
}
149142
150143
- name: Set up Docker Buildx
151144
uses: docker/setup-buildx-action@f7ce87c1d6bead3e36075b2ce75da1f6cc28aaca # v3

Dockerfile

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,20 @@ WORKDIR ${APP_HOME}
2525
FROM base AS dev
2626

2727
ARG DEBIAN_FRONTEND=noninteractive
28+
COPY <<-EOF /etc/apt/apt.conf.d/99-disable-recommends
29+
APT::Install-Recommends "false";
30+
APT::Install-Suggests "false";
31+
APT::AutoRemove::RecommendsImportant "false";
32+
APT::AutoRemove::SuggestsImportant "false";
33+
EOF
2834
RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \
35+
--mount=type=cache,target=/var/lib/apt,sharing=locked \
2936
rm -f /etc/apt/apt.conf.d/docker-clean && \
37+
echo 'Binary::apt::APT::Keep-Downloaded-Packages "true";' > /etc/apt/apt.conf.d/keep-cache && \
3038
apt-get update && \
31-
apt-get install --no-install-recommends -y \
39+
apt-get install --yes \
3240
build-essential \
33-
curl \
34-
&& rm -rf /var/lib/apt/lists/*
41+
curl
3542

3643
ARG PIP_DISABLE_PIP_VERSION_CHECK=1 \
3744
PIP_NO_CACHE_DIR=0 \

0 commit comments

Comments
 (0)