Where it is
~/Library/Containers/com.docker.docker/Data/vms/0/data/Docker.rawIts real size
Docker.raw is a sparse file. Finder and ls show the maximum size you allowed, not what it uses. Compare:
ls -lh ~/Library/Containers/com.docker.docker/Data/vms/0/data/Docker.raw
du -h ~/Library/Containers/com.docker.docker/Data/vms/0/data/Docker.rawThe du number is what it really takes on disk.
See what is inside
docker system df
docker system df -vFree space, safest first
- Build cache (always rebuildable):Terminal
docker builder prune - Stopped containers, unused networks and dangling images:Terminal
docker system prune - Every image not used by a container (they download again on the next pull):Terminal
docker image prune -a
docker system prune --volumes and docker volume prune delete volumes that no container uses right now, and a stopped database's data may be one of them. List them first with docker volume ls and back up anything you need.Run du -h on Docker.raw again afterwards to see what you got back. You can also lower the maximum in Docker Desktop → Settings → Resources → Virtual disk limit.
Questions
Why is Docker.raw so big?
Finder shows its maximum size because it is a sparse file. Use du -h to see the real size, and docker system df to see what fills it.
Is it safe to delete Docker.raw?
Only if you are fine losing every image, container and volume. Use docker system prune instead.
Junk Raccoon finds this clutter for you, shows every file first, and keeps a one-click way back. Free beta for Mac.
Download for Mac
