Docker Desktop runs containers in a small Linux virtual machine, and that machine’s whole disk is one file on your Mac: Docker.raw. Every image you pull, every container, volume and build cache lives inside it. Deleting things inside Docker frees space inside that file; getting the space back on your Mac takes a step more.
Check its real size first
The file is at:
~/Library/Containers/com.docker.docker/Data/vms/0/data/Docker.rawFinder and ls -lh show its maximum size, often 64 GB or more, because it’s a sparse file. What it really takes on the disk is usually less. To see that:
du -h ~/Library/Containers/com.docker.docker/Data/vms/0/data/Docker.rawIf the real figure is small, Docker isn’t your problem, whatever Finder says.
See what’s inside
With Docker Desktop running:
docker system dfIt lists how much images, containers, local volumes and the build cache take, and how much of each is reclaimable. Add -v for the detail.
Free space, safest first
docker builder prune # build cache: rebuilt by your next build
docker image prune -a # images no container uses: pulled again when needed
docker container prune # stopped containersdocker system prune -a does all three in one go, and asks before it starts.
Volumes hold your data
Volumes are where containers keep data that outlives them, such as the files of a local database. Pruning them deletes that data for good. Check what’s there first:
docker volume lsRemove only volumes of projects you’re done with, by name with docker volume rm, or export anything you need before running docker volume prune.
Getting the space back on your Mac
Docker Desktop hands space freed inside Docker.raw back to macOS on its own. Run the du command above again to check. If the figure hasn’t dropped after a few minutes, quitting and reopening Docker Desktop usually makes it happen.
Stop it growing again
In Docker Desktop, Settings › Resources › Advanced sets the disk’s size limit (called Virtual disk limit in recent versions). A lower limit means Docker tells you it’s out of space instead of quietly filling your Mac. Running docker builder prune every few weeks keeps the build cache, usually the fastest-growing part, in check.
What not to do
- Don’t delete Docker.raw by hand. It holds every image, container and volume. Deleting it, or choosing Troubleshoot › Clean / Purge data, wipes them all.
- Don’t prune volumes without looking. A database volume is often the one thing in Docker you can’t get back.
While Docker is running, Unslow asks it how much it could reclaim, lists that alongside your other developer caches, and shows the command that clears it, rather than reaching into Docker’s data itself.