Skip to content

Gotcha: Docker build cache is not removed by image prune

docker image prune leaves BuildKit cache behind; it can be the biggest thing on a CI agent.

GotchaCreated Updated

Also:build cache · buildx · buildkit · docker builder prune · no space left on device

The surprise: docker image prune -af freed almost nothing, yet /var/lib/docker was still 40 GB.

Why: BuildKit’s build cache is separate from images. Only docker builder prune (or docker system prune) removes it. Check with Docker: Show disk used by Docker and look at the Build Cache row.

Fix / do this instead:

Terminal window
docker builder prune -af --filter "until=24h"

Seen in: Incident 2026-11-20: Disk full on Jenkins agent

My DevOps Playbook by Angelo John Calleja

New runbook

GitHub not connected

Saving is handled by the site: the GitHub token is stored in Cloudflare, not in your browser. Enter the editor password (the EDITOR_PASSWORD secret) to unlock saving in this browser.

Saving commits to gelogrammer/My_DevOps_Playbook. Create a fine-grained token with access to only this repo andContents: Read and write, then paste it here. It is stored only in this browser.

src/content/docs/…