Find What Is Using Disk With docker system df
Read the docker system df summary, find the big image or volume with the verbose form, and decide what is safe to remove. After this, you can find where the space went without running a broad prune.
Docker's disk space disappears in four places: images, containers, volumes and build cache. docker system df tells you how much each one takes, and the verbose form tells you which items. This page uses it to find out what is big, and ends with the rule I follow before I delete anything.
The summary
docker system df
TYPE TOTAL ACTIVE SIZE RECLAIMABLE
Images 41 16 35.64GB 20.79GB (58%)
Containers 16 4 14.27MB 8.417MB (58%)
Local Volumes 32 10 3.623GB 382.7MB (10%)
Build Cache 371 3 25.75GB 13.57GB
Four rows. TOTAL is how many items exist, ACTIVE how many are in use by a container, and RECLAIMABLE is what could be freed. The numbers above come from my own development computer, so yours will be different. Two things to read first: a large build cache is usually safe to clear, and a reclaimable volume may be a database you meant to keep. Volumes are the row to be careful with.
Which item is the big one
docker system df -v lists every image, container, volume and cache entry with its size. On a busy computer that is a long list with your own project names in it, so I will not show mine. Make a clear example instead: a volume with 20 MB in it, and an image that carries a 30 MB file.
FROM alpine:3.24
COPY filler.bin /filler.bin
Set-Location disk-demo
[IO.File]::WriteAllBytes("$PWD\filler.bin", (New-Object byte[] 30MB))
docker build -q -t disk-demo-image:1 . | Out-Null
docker volume create disk-demo-vol | Out-Null
docker run --rm -v disk-demo-vol:/data alpine:3.24 sh -c "head -c 20971520 /dev/zero > /data/filler.bin"
docker system df -v | Select-String "disk-demo" | ForEach-Object { $_.ToString().Trim() }
disk-demo-image 1 fc315d572e3c 2 seconds ago 44.4MB 12.93MB 31.5MB 0
disk-demo-vol 0 20.97MB
I filtered the verbose output to my demo names, so only they appear. The image line shows 44.4 MB in total. Of that, 12.93 MB is the Alpine base, which other images share, and 31.5 MB is unique to this image: the 30 MB file I added. The volume line shows 20.97 MB, the file I wrote into it. Without a filter, use docker system df -v | more, or look at one section at a time, and sort by the size column.
For a single type, the normal commands also show sizes. A container shows its writable layer with docker ps -s, and an image has its size in docker image ls.
docker image ls disk-demo-image --format "{{.Repository}}:{{.Tag}}"
disk-demo-image:1
What to do about it
- Stopped containers and old images: remove them by name, one at a time. Stopped containers hold on to their image, so remove the containers first.
- Build cache:
docker builder pruneclears it. I did not run it for this page, because it would clear the cache for all my other projects. The next builds are slower, and that is the only cost. - Volumes: look at the name and ask what put it there before you remove it.
docker volume rmdeletes the data with no undo.
⚠ Warning: docker system prune removes all stopped containers, all unused networks and all dangling images in one go, and --volumes adds unused volumes with their data. It acts on everything on the machine, not on one project. Read what it lists before you say yes, and prefer the narrow commands.
docker image rm disk-demo-image:1
docker volume rm disk-demo-vol
Related course: Docker Intermediate.
About
Read the docker system df summary, find the big image or volume with the verbose form, and decide what is safe to remove. After this, you can find where the space went without running a broad prune.
- Responsible
- Mary Q
- Last Update
- 08/03/2026
- Reading Time
- 4 min
Reviews
Sign in to write a reviewComments (0)
Sign in to commentNo comments yet.