Docker filling your Mac's disk? How to get the space back
Last updated 17 October 2026
Docker Desktop on a Mac runs containers inside a small Linux virtual machine, and everything that VM stores (images, containers, volumes and build cache) lives in a single disk image file. That file grows as you work and doesn't shrink on its own when you delete things in Finder. Here's how to clean it from the inside.
Find the file
The disk image is Docker.raw, under ~/Library/Containers/com.docker.docker/Data/vms/0/data/. It's a sparse file, so Finder may show its maximum size rather than the space it actually takes. ls -ls shows the real usage in the first column:
ls -lsh ~/Library/Containers/com.docker.docker/Data/vms/0/data/Docker.rawDon't delete this file to save space. It holds every image, container and volume, including any databases you run in Docker.
See what's using the space
docker system dfThis splits usage into images, containers, local volumes and build cache, and shows how much of each is reclaimable. Add -v for a per-item breakdown.
Safe cleanups, safest first
- Build cache:
docker builder prune. Layers rebuild on your next build; the only cost is a slower first build. - Dangling images:
docker image prune. These are untagged layers left behind by rebuilds. - Stopped containers:
docker container prune. Checkdocker ps -afirst if you keep stopped containers around on purpose. - All unused images:
docker image prune -a. Removes every image not used by a container; they download again when you next need them.
Be careful with docker volume prune and with docker system prune --volumes: volumes hold data, such as a local Postgres database, and removing them deletes that data for good.
Stop it growing back
Docker Desktop's Resources settings let you cap the size of the virtual disk. A lower limit forces you to prune sooner but keeps Docker from quietly taking over your Mac. Running docker builder prune now and then keeps the build cache in check.
How DiskCity handles Docker
DiskCity is in development. It treats Docker's build cache and dangling images as rebuildable and cleans them with docker builder prune and docker image prune, never by touching files. The Docker.raw disk image itself is marked never-touch, so no plan will ever include it. Join the waitlist to hear when it launches.