Interview Prep/Docker/Build Performance & CI

How do you reduce `apt` layer bloat and improve reproducibility?

IntermediateProductionBuild Performance & CI
Answer
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 --no-install-recommends ca-certificates=20230311 curl

(When using cache mounts, disable the Debian docker-clean hook.) Pin or snapshot repos (snapshot.debian.org) if you need byte-reproducible builds.

All Docker questions Roadmap: Docker & containers

More on Build Performance & CI