Docker.raw too big on Mac? How to shrink it
Docker Desktop on Mac runs Linux in a virtual machine, and everything inside it (images, containers, volumes and build cache) lives in a single disk image called Docker.raw. It grows as you pull and build, and it's often 20–60 GB.
Where it is, and why Finder's size is misleading
~/Library/Containers/com.docker.docker/Data/vms/0/data/Docker.raw
Docker.raw is a sparse file: Finder shows its maximum size (the virtual disk limit), not the space it actually uses. To see the real usage on your Mac:
du -h ~/Library/Containers/com.docker.docker/Data/vms/0/data/Docker.raw
Don't delete Docker.raw directly. That wipes every image, container and volume at once. Clean from inside Docker instead, so you choose what goes.
See what's using the space
docker system df
This splits usage into images, containers, local volumes and build cache, with a "reclaimable" column.
Clean it up, from safest to most aggressive
# Build cache (usually the biggest, always safe)
docker builder prune
# Stopped containers, unused networks, dangling images
docker system prune
# Also every image not used by a container
docker system prune -a
Be careful with volumes. docker system prune --volumes also deletes volumes not attached to a container, and volumes often hold databases. Run docker volume ls first and only prune volumes you're sure about.
Docker Desktop releases the freed space back to macOS automatically after a pruning; it can take a minute to show up.
Cap how big it can get
In Docker Desktop, go to Settings › Resources › Advanced and lower the virtual disk limit. Docker Desktop can't use more than that, so it stops creeping up on a small SSD.
Rather see it all at once? Storage Cleaner shows Docker's unused images and build cache next to every other developer and AI hoard, and removes them through Docker itself. It tells you before confirming that this can't be undone, unlike the files it moves to the Trash. Scanning is free.
Try Storage Cleaner freeFrequently asked
Will I lose my containers? Only the ones you prune. docker system prune leaves running containers and the images they use alone.
I use Colima or OrbStack instead. They use their own virtual disks, but the same docker system df and prune commands work.