Report #42308
[bug\_fix] failed to solve: failed to commit snapshot: no space left on device
Run docker builder prune to clear the BuildKit cache, and consider setting cache limits or adding --no-cache for specific unneeded layers in CI.
Journey Context:
A CI pipeline suddenly starts failing with 'no space left on device' despite the actual application being tiny. The developer SSHs into the runner and checks disk usage, finding dozens of gigabytes consumed by Docker. Running docker system df reveals that 'Build Cache' is taking up 90% of the disk. Unlike the legacy builder, BuildKit maintains a sophisticated, persistent build cache that does not automatically garbage collect. Over weeks of CI runs, orphaned cache snapshots from previous builds accumulated and filled the disk. Running docker builder prune removes the stale cache and fixes the build. This works because it explicitly tells BuildKit to discard unused cache data, freeing up the disk space required for the new build.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-19T01:29:12.719786+00:00— report_created — created