Shrink Docker’s disk image
Last updated November 21, 2026
On a Mac, Docker Desktop keeps every image, container, volume and build cache in one disk image, so macOS sees a single big file. To make it smaller, you clear things out from inside Docker, and Docker hands the space back.
See how big it really is
The disk image is Docker.raw, in ~/Library/Containers/com.docker.docker/Data/vms/0/data. Many tools show the most it may grow to, not the space it really takes. This shows both:
ls -klsh ~ /Library /Containers /com.docker.docker /Data /vms /0 /data /Docker.rawThe first number is what it takes on your disk, and the size further along the line is its limit. Docker Desktop shows the same under Settings > Resources > Advanced. To see what fills it, by images, containers, volumes and build cache:
docker system dfClear out what you don’t use
This removes stopped containers, networks no container uses, dangling images and build cache. Docker says what it will remove and asks before it does:
docker system pruneAdd -a to remove every image no container uses as well. Images download again the next time you need them, so it only costs time:
docker system prune -aNeither touches volumes, where your containers keep databases and other data. docker volume ls lists them, and docker volume rm followed by a name deletes one you’re sure about.
Get the space back
After a prune, it can take a few minutes for the space to show up as free on your Mac. To have Docker hand it back right away:
docker run --privileged --pid=host docker /desktop-reclaim-spaceDeleting files inside a running container doesn’t free space on your Mac; pruning does.
To keep the image from growing as large again, lower its limit under Settings > Resources > Advanced. Lowering it deletes the disk image and everything in it, so Docker can start a smaller one: prune first, and lower it only if you can rebuild what’s inside.
How Diskwise handles it
Diskwise’s free scan shows Docker’s disk image when Docker Desktop is installed. It’s Your call, and stays unticked: ticking it moves the whole image to the Trash, with every container, image and volume inside it. That’s only worth it once you’re done with Docker, and with Docker Desktop quit. While you still use Docker, prune from inside it as above.
Rather not do it by hand?
Diskwise finds what fills your Mac, from build data to caches, sizes it honestly and clears what’s safe in one click. The scan is free.