Docker Layer Cache Filled the Runner Disk
The Docker data root filled because layer and build caches accumulated across jobs. Once /var/lib/docker is full, any pull, build, or run that writes a layer fails with ENOSPC.
What this error means
Docker operations fail with no space left on device, and docker system df shows a large reclaimable build cache. Pruning or a fresh runner clears it with no Dockerfile change.
docker
$ docker system df
TYPE TOTAL ACTIVE SIZE RECLAIMABLE
Build Cache 142 0 31.7GB 31.7GB (100%)
Error: failed to register layer: no space left on deviceCommon causes
BuildKit cache grows unbounded on reused runners
The build cache persists between jobs on a long-lived runner and is never reclaimed until it fills the disk.
Many image layers and dangling images
Repeated builds leave dangling images and intermediate layers that pile up in the docker data root.
How to fix it
Prune the builder and dangling layers
Reclaim the build cache and unused images.
shell
docker system df
docker builder prune --all --force
docker image prune --all --forceCap or scope the cache
- Set a cache size limit on the BuildKit builder.
- Prune the builder cache at the start of heavy build jobs.
- Use a runner with a larger disk for image-heavy pipelines.
How to prevent it
- Bound the BuildKit cache size.
- Prune dangling images between builds.
- Right-size disk for build-heavy runners.
Related guides
docker build: "write error: no space left on device"Fix "write error: no space left on device" during docker build in CI when layers and the build cache fill the…
CI "No space left on device" (ENOSPC) on the RunnerFix "No space left on device" (ENOSPC) in CI when the runner disk fills with caches, layers, and artifacts. H…
tar: "write error: No space left on device" Restoring CacheFix "tar: write error: No space left on device" when CI restores a cache that outgrew the runner disk. How to…
CI "No space left on device" with Free Bytes (Inode Exhaustion)Fix "No space left on device" when df shows free bytes: the runner ran out of inodes, not space. How to confi…