Reclaim disk space from Docker
Docker can silently use 20+ GB. Measure, then clean in order from safest to most aggressive.
Measure
The RECLAIMABLE column is what you can free.
docker system dfTYPE TOTAL ACTIVE SIZE RECLAIMABLE Images 23 4 9.8GB 7.1GB (72%) Build Cache 188 0 3.2GB 3.2GB
Remove stopped containers
Safe if you don’t need their filesystem state.
docker container pruneRemove dangling images
Leftover layers from old builds.
docker image pruneGo all in
Removes every image not in use and the build cache. Volumes (data) are kept.
docker system prune -aYou’ll need to re-download or rebuild images. Volumes are kept unless you add --volumes.