Interview Prep/Docker/Multi-stage builds, cache, tags and registries

Disk on the build server keeps filling up with images.

BeginnerScenarioMulti-stage builds, cache, tags and registries
Answer

Situation read → Old tags, dangling layers and build cache accumulate.

What I'd do →

docker system df
docker image prune -a --filter "until=168h"
docker builder prune --filter "until=72h" --keep-storage 20GB

Run it from a nightly cron or a CI cleanup job and configure BuildKit GC in buildkitd.toml.

Why → docker system prune -a is blunt and can delete images other jobs need.

Interview tip → Do not prune volumes unattended; that deletes data.

All Docker questions Roadmap: Docker & containers

More on Multi-stage builds, cache, tags and registries