Docker is using too much disk space on a Mac: what to delete and what never to touch

How Docker Desktop stores data on macOS, why Docker.raw looks larger than it is, and the docker commands that reclaim space safely.

On macOS, Docker runs inside a Linux virtual machine, and everything it stores (images, containers, volumes, build cache) lives inside one disk image file. That file is where the space goes, and it is also the one thing you must not delete from Finder.

See the real size

ls -lh ~/Library/Containers/com.docker.docker/Data/vms/0/data/Docker.raw   # logical size
du -h  ~/Library/Containers/com.docker.docker/Data/vms/0/data/Docker.raw   # space actually used

Docker.raw is a sparse file. ls shows the maximum it may grow to; du shows what it occupies now. The two can differ by tens of gigabytes.

Ask Docker what is inside

docker system df        # images, containers, volumes, build cache
docker system df -v     # the same, itemised

Reclaim space, from least to most destructive

docker builder prune            # build cache only
docker image prune              # dangling images
docker container prune          # stopped containers
docker system prune             # all of the above, plus unused networks
docker system prune -a --volumes   # also every unused image and volume

Volumes hold databases and other state. --volumes deletes every volume no container is using right now, including the Postgres data for the project you stopped yesterday.

Never delete the disk image by hand

Removing Docker.raw from the host destroys every image, container and volume at once, and nothing inside it can be rebuilt from the host side. If you want a smaller file, lower the limit under Settings › Resources in Docker Desktop, or use “Clean / Purge data” under Troubleshoot, which is the supported way to start over.

How Siftaway handles this

Siftaway shows the disk image with both sizes and marks it Protected: it is reported, never touched. For build cache and dangling images it points you to the docker commands above, because the runtime manages that space better than a file deletion can.