Docker using too much disk space on a Mac: Docker.raw explained
On a Mac, Docker runs inside a virtual machine, and every image, container, volume and build cache lives in that machine's disk: one large file.
The short answer: Docker Desktop's disk is ~/Library/Containers/com.docker.docker/Data/vms/0/data/Docker.raw. Don't delete it: free space inside it with docker system df to see what's there and the docker … prune commands to remove it.
Why does Docker.raw look so huge?
It's a sparse file: Finder shows the size it may grow to (the limit set in Docker Desktop), not what it really uses. To see the real figure:
du -h ~/Library/Containers/com.docker.docker/Data/vms/0/data/Docker.raw
What is using Docker's space?
docker system df
docker system df -v
The first command shows images, containers, local volumes and build cache, with how much of each could be reclaimed. The second lists them one by one.
Which commands free space safely?
docker builder prune: build cache no build is using. Builds are slower once afterwards.docker image prune: dangling images (untagged leftovers of rebuilds). Add-ato remove every image no container uses; they download again when needed.docker container prune: stopped containers. Anything written inside them, outside a volume, is lost.docker volume prune: unused volumes. Careful: volumes hold databases and other data. In recent versions it removes only anonymous volumes unless you add-a.docker system prunedoes the first three at once;-aand--volumesmake it go further.
Does Docker.raw shrink after pruning?
Usually, yes: because the file is sparse, space freed inside it goes back to macOS, sometimes after a few minutes. Check again with the du command above. If it doesn't, quit and restart Docker Desktop.
Can I limit how big Docker gets?
Yes. In Docker Desktop, open Settings › Resources › Advanced and lower the disk usage limit. Lowering it below what's stored may require resetting Docker's data.
Should I delete Docker.raw?
Only if you want to lose everything in Docker: all images, containers and volumes. Docker Desktop creates an empty one on its next start. Troubleshoot › Clean / Purge data in Docker Desktop does the same, more cleanly.
Where do OrbStack, Colima and Podman keep their disks?
- OrbStack: under
~/.orbstack(or the data folder chosen in its settings). The samedockercommands work against it. - Colima: the Lima VM disks under
~/.colima.colima deleteremoves the whole VM. - Podman: machine disks under
~/.local/share/containers/podman/machine;podman system prunefrees space inside.