On Apple Silicon, Docker Desktop stores a Linux VM behind a sparse disk usually named Docker.raw. Finder can show a huge file while du reports far less allocated space. Reclaim room with docker system df and prune. Never delete Docker.raw — that wipes images, containers, and volumes in one shot. No SIP changes, no /System deletes.

Logical size vs allocated size

A sparse file can claim tens of gigabytes of logical capacity while occupying fewer blocks on APFS. ls -lh and Finder’s headline size follow the logical number. du -h (and Get Info “size on disk”) follow allocated blocks. Those two numbers disagree on purpose. That is not a corrupt disk and it is not a reason to delete the VM image.

Docker.raw typically sits under Docker Desktop’s data directory in ~/Library. You can measure it with du if you find the file — still do not move it to Trash. Docker Desktop Settings → Resources may show a disk-image size cap; that cap is not current use.

Measure with docker system df

Start Docker Desktop so the engine is running. Then:

zsh — docker df
$ docker system df
$ docker system df -v

The summary lists Images, Containers, Local Volumes, and Build Cache, each with a reclaimable column. -v names the objects. That is the map for prune — not Finder’s view of Docker.raw.

Prune unused images, containers, and build cache

Work from least to most aggressive. Stop containers you still need before pruning.

zsh — prune
# stopped containers
$ docker container prune
# dangling images only
$ docker image prune
# build cache
$ docker builder prune
# unused containers, networks, dangling images
$ docker system prune

docker image prune -a also drops unused tagged images. You will re-pull them later. docker system prune -a is the same idea, broader. Use those only when you accept re-downloading images.

Volumes: review before prune

Named volumes often hold Postgres, Redis, or app state. docker system prune without --volumes leaves them alone. docker volume prune and docker system prune --volumes delete volumes not attached to a container — including data you still want after a compose down.

zsh — volumes
$ docker volume ls
# inspect before any volume prune
$ docker volume inspect VOLUME_NAME

Never delete Docker.raw

Do not Trash, rm, truncate, or “replace with empty file” the VM disk. That is not compacting. It destroys the engine’s disk. After a successful prune, allocated size may drop slowly; that is still not a reason to touch Docker.raw. If Docker Desktop offers a supported reclaim or compact control in its own UI, use that — never Finder-delete the raw file.

Also skip SIP disable and any cleanup under /System, /Library, or /usr. Docker’s reclaim path is the docker CLI (and Docker Desktop settings), all inside your user data.

Optional prune mapping in a GUI

The commands above are the whole workflow. If you prefer a review list afterward, MacOSCleaner Smart Cleanup can surface its Docker category mapped to prune-style targets (unused images, containers, related build cache) with risk badges — not a Finder delete of Docker.raw. Optional. Related: Xcode caches and System Data reclaim order.

Frequently asked questions

Why is Docker.raw so large on Mac?
Docker.raw is a sparse virtual disk. Finder and ls -lh show logical capacity. du shows allocated blocks. Those numbers often disagree; that is expected. Do not delete the file to “fix” the logical size.
Is docker system prune safe for volumes?
docker system prune without --volumes leaves volumes alone. docker volume prune and docker system prune --volumes delete unused volumes, which often hold databases and app data. Review named volumes first.
Can I delete Docker.raw in Finder?
No. Deleting Docker.raw destroys the Linux VM: images, containers, and volumes. Reclaim space with docker prune commands instead.

Automate developer cleanup with MacOSCleaner

Rather than hunting gigabytes across manual terminal commands, MacOSCleaner scans Docker reclaimable targets, Xcode caches, Homebrew packages, and app leftovers in seconds. 100% native Swift 6, zero telemetry; direct removeItem for confirmed caches, Trash (trashItem) for review-only, uninstaller, disk analyzer, and duplicates.