Key points
- Docker Desktop is a Linux virtual machine; its disk image grows on demand and does not shrink automatically.
- The current host path is ~/Library/Containers/com.docker.docker/Data/vms/0/data/Docker.raw.
- docker system df reports images, containers, volumes and build cache with a reclaimable column.
- docker system prune -a removes unused images and build cache but leaves data volumes untouched.
- Resetting or deleting the disk image frees all reclaimed space but destroys every image, container and volume.
Docker Desktop on macOS runs containers inside a Linux virtual machine, and that VM stores everything in one disk image. Images, containers, build cache and volumes all live inside that file, so Finder cannot tell you what is safe to remove. Use Docker’s own tools to measure and prune, and treat the disk image itself as a reset-only option.
Why Docker uses so much space
Each image is a stack of layers, and old tags keep their layers until nothing references them. Build cache adds storage, stopped containers keep writable layers, and volumes persist independently. The VM disk image grows on demand and does not shrink every time you delete something inside it, so the host file can stay large after docker system prune.
Where Docker stores data on macOS
In current Docker Desktop releases:
~/Library/Containers/com.docker.docker/Data/vms/0/data/Docker.raw
Older releases used other file names under ~/Library/Containers/com.docker.docker/Data, including a Docker.qcow2 disk. The safest way to locate the current file is to inspect that container directory rather than relying on a path from an old tutorial.
docker info prints a Docker Root Dir, usually /var/lib/docker. That path exists inside the Linux VM, not on your Mac. Files there are not directly accessible from Finder, and deleting the host disk image while Docker runs can corrupt the VM.
To see the host file size:
du -h ~/Library/Containers/com.docker.docker/Data/vms/0/data/Docker.raw
ls -lh ~/Library/Containers/com.docker.docker/Data/vms/0/data/Docker.raw
du reports allocated blocks; ls -lh reports logical size. For a sparse file, these can differ.
Measure what Docker is using
docker system df
docker system df -v
The summary splits usage into images, containers, local volumes and build cache, with a reclaimable figure for each. The detailed view lists individual images and their shared sizes. Docker reports decimal units, so 1 GB means 1,000,000,000 bytes, not 1,073,741,824.
Prune what is unused
Start with the least destructive commands and read the prompt each one prints:
docker container prune
docker image prune
docker builder prune
docker container prune removes stopped containers. docker image prune removes dangling images only. docker builder prune clears build cache and makes the next build slower.
When you need more space:
docker image prune -a
This removes every image not referenced by a container, including images you might want later. Re-pulling them costs time and bandwidth.
docker system prune combines stopped containers, unused networks, dangling images and build cache. Adding -a includes all unused images. None of these commands removes volumes by default.
Remove unused volumes carefully
docker volume ls
docker volume prune
A volume can hold a database, uploads or other data that cannot be rebuilt from an image. Identify each volume before removing it. Recent Docker versions remove only anonymous volumes by default; docker volume prune --all includes named volumes. docker system prune -a --volumes is the broadest option and should be treated as destructive.
Reclaim the disk image itself
If pruning does not return space to macOS, reset the image:
- Quit Docker Desktop completely from the menu bar.
- Confirm no Docker process is running.
- Move
Docker.rawto the Trash, or use Docker Desktop’s Troubleshoot > Clean / Purge data option. - Start Docker Desktop and let it create a fresh image.
Every image, container, volume and build cache is gone after this. Docker Desktop’s Reset to factory defaults does the same thing and also resets settings.
You can set a maximum size under Settings > Resources > Advanced > Disk image size, and you can move the image to an external drive from the same panel. Changing the size is not a substitute for pruning, and lowering it may not shrink the existing file immediately.
Keep Docker small going forward
- Use
docker run --rmfor one-off containers. - Remove containers when a task is finished instead of letting them accumulate.
- Prefer multi-stage builds and slim base images.
- Add a
.dockerignoreso build contexts do not includenode_modules,.gitor datasets. - Bind-mount large datasets from the Mac instead of copying them into an image, which keeps them out of the VM image.
- Use
docker compose down -vonly when you intend to delete the project’s volumes.
How Maclean handles Docker storage
Maclean’s developer-cache scan reports Docker Desktop VM data, Docker cache and Docker BuildKit cache. The VM data directory is display-only because deleting its files directly corrupts Docker; cleanup has to go through Docker Desktop or the Docker CLI.
Where Docker is running, Maclean also shows the space reclaimable through docker system prune -a, and runs that prune only after confirmation. The CLI view:
maclean scan --tab dev-cache
maclean clean --tab dev-cache --dry-run
Developer-cache tabs delete permanently in the CLI, so use --dry-run first; large files and duplicates use the Trash and maclean restore <id>. The app adds a review screen and a 14-day trial, while the CLI is free and open source under Apache-2.0.
For the other large developer folders, see Xcode Derived Data and node_modules disk space.
Bottom line
Docker’s space is concentrated in one host file, but safe cleanup happens inside Docker: measure with docker system df, prune containers, images and build cache, and review volumes first. Reset the disk image only when you accept losing all Docker data, and never touch Docker.raw while the VM is running.