Guides

Docker.raw huge on your Mac? How to shrink it

Docker Desktop keeps images, containers and volumes in one disk file that doesn't shrink on its own. Here's how to see its real size, prune what you don't need, and cap it.

Last checked 22 October 2026

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.raw

Finder 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.raw

If the real figure is small, Docker isn’t your problem, whatever Finder says.

See what’s inside

With Docker Desktop running:

docker system df

It 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 containers

docker 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 ls

Remove 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

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.