Where did 60 GB go? The hidden cost of Docker on your Mac
You haven't pulled a new image in weeks, yet your Mac's free space keeps shrinking. Open Finder, navigate to ~/Library/Containers/com.docker.docker/Data/vms/0/, and you'll likely find a single file — Docker.raw — sitting at 30, 50, sometimes 70 GB. That's Docker's virtual disk, and it only grows. It never shrinks on its own.
Here's how Docker eats your storage and what you can do about it — without breaking your containers.
Why Docker uses so much space
Docker on Mac runs inside a lightweight Linux virtual machine. Everything — images, containers, volumes, build cache — lives inside a single disk image file (Docker.raw or Docker.qcow2). Three things make it bloat fast:
- Dangling images — every time you rebuild, old intermediate layers stay behind
- Build cache — BuildKit stores layer caches aggressively to speed up builds, and rarely cleans up
- Unused volumes — when you remove a container, its data volume stays unless you explicitly delete it
Step 1: See what Docker is actually using
Before deleting anything, check the breakdown:
docker system df
This shows disk usage split into images, containers, volumes, and build cache — with a "reclaimable" column. That reclaimable number is your starting point.
Step 2: Prune the safe stuff
The single most useful command:
docker system prune
This removes stopped containers, unused networks, and dangling images. It's safe — anything currently running stays untouched. For most people, this alone frees 5–20 GB.
If you want to go deeper:
docker system prune -a— also removes images not used by any container (not just dangling ones). Good for a fresh start, but you'll re-download images next time you need them.docker builder prune— specifically clears the BuildKit cache. On active projects, this alone can reclaim 10–30 GB.docker volume prune— removes volumes not attached to any container.
docker volume prune without checking docker volume ls first. Named volumes you created intentionally will be removed if no container references them.Step 3: Shrink Docker.raw itself
Here's the frustrating part: even after pruning, Docker.raw may not shrink. The virtual disk file grows to accommodate data but doesn't automatically release space back to macOS.
The fix: open Docker Desktop → Settings → Resources → Disk image size. You can reduce the maximum size. Docker will compact the disk image on restart. Alternatively, if you've pruned aggressively, restarting Docker Desktop will often trigger a partial compaction.
For the nuclear option: delete Docker.raw entirely and restart Docker Desktop. It rebuilds from scratch — but you lose all images, containers, and volumes. Only do this if you've already pushed everything you care about.
Keep Docker lean going forward
- Add
docker system pruneto your weekly routine (or let a tool handle it) - Use
.dockerignorefiles to keep build contexts small - Set a disk image size limit in Docker Desktop settings — it prevents runaway growth
- Remove old projects' containers and volumes when you're done with them
Docker is just one piece of the developer cache puzzle. Between Docker, npm, Xcode, and Homebrew, dev tools can easily claim 100 GB+ on a Mac that "shouldn't be full."
Let Gigatidy handle the cleanup
Gigatidy scans your Mac — including Docker — and shows you exactly what's safe to remove. No guessing, no accidental data loss.
Meet Gigatidy →FAQ
Why is Docker.raw so large even with few containers?
Docker.raw is a virtual disk that grows as you pull images and build layers, but it doesn't automatically shrink when you delete things inside it. The free space stays allocated. Pruning removes the data; restarting Docker or adjusting the disk size limit compacts the file.
Will docker system prune delete my running containers?
No. It only removes stopped containers, dangling images, and unused networks. Running containers and their images are never touched.
How often should I prune Docker on Mac?
If you build images regularly, once a week is a good cadence. Build cache alone can accumulate several gigabytes per day on active projects.