CI build agents running Docker fail with "no space left on device" while pulling images; `/var/lib/docker` is 95% full.

IntermediateTroubleshootingDisk, memory and CPU
Answer

Likely causes → Docker never cleans up on its own: old images, stopped containers, dangling layers, unused volumes and BuildKit cache pile up with every build.

Diagnose →

docker system df -v | head -40
du -sh /var/lib/docker/* | sort -h

Fix →

docker container prune -f
docker image prune -a -f --filter "until=72h"
docker builder prune -f --keep-storage 20GB
docker volume prune -f

Prevent → Run the prune as a nightly systemd timer or cron on every agent, put /var/lib/docker on its own volume so a full disk doesn't kill the OS, and prefer ephemeral agents that are recreated per job.

All Real-World Interview questions Roadmap: Interview readiness

More on Disk, memory and CPU