DiskSpace AI

Docker taking up too much space on Mac? How to shrink Docker.raw

In short

Docker Desktop keeps everything (images, containers, volumes, build cache) in one virtual disk, Docker.raw. Run docker system df to see what's inside, docker system prune to clean what's unused, and be careful with volumes: that's where your databases live.

Where the space goes

Docker Desktop runs Linux in a small virtual machine, and that machine's disk is a single file:

~/Library/Containers/com.docker.docker/Data/vms/0/data/Docker.raw

Finder may show its maximum size, not what it really uses (it's a sparse file). To see the real figure:

du -h ~/Library/Containers/com.docker.docker/Data/vms/0/data/Docker.raw

See what's inside

docker system df

It lists images, containers, local volumes and build cache, with how much of each is reclaimable. Add -v for the detail of each item.

Clean what's unused

Make the file smaller

Recent Docker Desktop versions give freed space back to macOS by themselves, but it can take a few minutes. You can also lower the maximum in Settings → Resources → Advanced → Virtual disk limit. As a last resort, Troubleshoot → Clean / Purge data deletes everything (images, containers and volumes) and starts from zero.

Lighter alternatives

If you only need containers for development, OrbStack and Colima use disks that grow and shrink more easily. They still need the same prune commands from time to time.

DiskSpace AI does this for you

It analyzes your Mac in minutes, tells you what each folder is and only selects what recreates itself. Your files are kept 7 days in case you change your mind. Free during the beta.

Download the Beta

Folders in this guide

More guides