Docker Desktop using too much disk space on a Mac
On a Mac, Docker does not store images and containers in many small folders. Docker Desktop runs a small virtual machine, and everything lives in one large disk file inside it. That file can reach tens of gigabytes and is easy to forget, because no single folder shows what is in it.
See what takes the space
Ask Docker, not the Finder:
docker system df
You get a table with Images, Containers, Local Volumes and Build Cache, with the total size of each and how much is reclaimable. Add -v for the detail of each image and volume.
Remove what is safe to remove
The gentle option. Removes stopped containers, unused networks, dangling images and the build cache:
docker system prune
Docker lists what it is about to delete and asks you to confirm.
Remove only the build cache, which is often the biggest part:
docker builder prune
Remove images you are not using:
docker image prune -a
-a removes every image that is not used by a container, not only the untagged ones. You will pull them again when you need them.
The dangerous one
docker system prune -a --volumes
This also removes volumes that no container uses. Volumes are where databases keep their data. A volume that is not attached to a running container right now is not necessarily unneeded. Run docker volume ls and look before you add --volumes.
Why the disk file stays big
Docker Desktop keeps its data in a virtual disk image, a file under:
~/Library/Containers/com.docker.docker
The exact file name depends on your Docker Desktop version. When you prune, Docker frees space inside that file. Whether macOS gets the space back immediately depends on the version and the settings, and it often does not. If the file stays big after a prune, look in Docker Desktop’s settings: the Resources section shows the disk image size and limit, and recent versions offer a way to reclaim space or reset the disk image. Resetting deletes everything, so use it only when you are happy to lose all images, containers and volumes.
Set a limit so it does not grow forever
In Docker Desktop → Settings → Resources, you can limit the size of the virtual disk. A smaller limit makes the problem visible sooner: Docker will complain before your Mac fills up.
What it costs
- Images and build cache: pulled or built again next time, so a slower start.
- Containers: stopped ones are removed. Data that was only inside them is gone.
- Volumes: data that was only in them is gone for good.
One more reason your disk looks full
Docker is one of several things that count toward the grey bar in Storage. See why System Data gets so big on a developer Mac and the full checklist.
Quick answers
Does docker system prune delete my volumes?
Not by default. It removes stopped containers, unused networks, dangling images and build cache. Volumes are removed only if you add the --volumes flag, so check that you do not need them first.
Why is the Docker disk file still large after pruning?
Docker Desktop stores everything in one virtual disk file, and macOS does not always get the freed space back right away. The file can stay large even after you removed the data.
Where does Docker Desktop keep its data on a Mac?
In a disk image inside ~/Library/Containers/com.docker.docker. The exact file name depends on the Docker Desktop version.