J. JieraltField Notes
Technical guide

Docker is filling the disk: measure before pruning

Separate filesystem pressure from Docker image, container and volume usage, and identify persistent data before cleanup.

Find out which resource is actually full

A disk alert does not automatically mean Docker has excess garbage. Check filesystem space and inodes, then inspect Docker's accounting:

df -h
df -i
docker system df -v

Check whether Docker's data root is on a separate mount and whether logs are growing unexpectedly. Do not delete files directly under /var/lib/docker; that can corrupt Docker state or lose data.

Identify what can be reclaimed

docker ps -a
docker image ls
docker volume ls
docker system df

Distinguish disposable stopped containers and rebuildable images from persistent volumes. A volume can hold a database or uploads; not being mounted by a running container does not prove it is safe to remove.

Clean up deliberately

If space must be freed, remove only objects you have identified and can recreate. docker system prune removes unused resources; do not casually add --volumes or put destructive cleanup into an unattended scheduled job. Back up important data and confirm how it can be restored first.

Run df -h and docker system df again to measure what was reclaimed. If the disk fills again quickly, investigate log rotation, build-cache growth and application writes instead of repeatedly pruning.

References

Still not working after these steps?

Send me the error and your environment for a free first diagnosis. Hands-on help is quoted before any work starts.

Get a free checkor ask the forum
Want new fixes as they land?Subscribe via RSS →