Update apt cache example (fix warning)

Fixes warning from `apt`:

> WARNING: apt does not have a stable CLI interface. Use with caution in scripts.

Signed-off-by: Rodolfo Carvalho <rhcarvalho@gmail.com>
This commit is contained in:
Rodolfo Carvalho
2026-01-06 15:44:45 +01:00
committed by GitHub
parent e79956392a
commit 2f2458b84b

View File

@@ -880,7 +880,7 @@ FROM ubuntu
RUN rm -f /etc/apt/apt.conf.d/docker-clean; echo 'Binary::apt::APT::Keep-Downloaded-Packages "true";' > /etc/apt/apt.conf.d/keep-cache
RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \
--mount=type=cache,target=/var/lib/apt,sharing=locked \
apt update && apt-get --no-install-recommends install -y gcc
apt-get update && apt-get --no-install-recommends install -y gcc
```
Apt needs exclusive access to its data, so the caches use the option