What it means
Docker keeps every image layer, stopped container, volume and build cache until you remove them, and by default container logs grow without limit. On a busy host or CI runner they fill the disk.
Causes and fixes
Most likely first. Run the check, and if it matches, apply the fix.
1. Unused images, containers and build cache
Check:
docker system df
Fix: docker system prune (add -a for unused images; volumes only with care, they hold data).
2. A container's json log file grows forever
Check:
du -sh /var/lib/docker/containers/*/*-json.log | sort -h | tail
Fix: Set log-opts max-size and max-file in /etc/docker/daemon.json (or per service in Compose).
3. A huge build context or image (node_modules, .git, data copied in)
Check:
docker history <image>
Fix: Add a .dockerignore and use multi-stage builds.
Fix it yourself
A live machine in your browser with this problem already on it. The grader checks the result.
- Keep Secrets and Junk out of the Build Contexteasy 5 min
- Shrink an Image with a Multi-Stage Buildmedium 7 min
- Find What Is Filling the Diskeasy 4 min
No account needed for your first tries.
Related errors
- No space left on device
A write failed because the filesystem is full, or out of inodes, or a deleted file is still held open.