Docker Using Too Much Space on Mac: Reclaim It
In short: Docker Desktop can quietly eat tens of gigabytes on your Mac through a single disk-image file. Here is how that space builds up, and how to reclaim it with prune commands and image maintenance you can trust. No guesswork, no risky manual deletes.
If Docker is using too much space on your Mac, you are not imagining it. A busy development machine can easily hand Docker 40, 60, even 100 GB over a few months, and most of it hides inside a single file you never see in Finder. The good news: almost all of that space is reclaimable, and you can get it back without touching a single system file or deleting anything you might regret.
This guide explains where the space actually goes, how to reclaim it with Docker's own tools, and how to keep it from creeping back.
Where Docker's disk space actually goes
On macOS, Docker Desktop does not scatter containers and images across your filesystem. It stores everything inside one virtual disk image. On Apple silicon and recent Docker versions this lives at ~/Library/Containers/com.docker.docker/Data/vm/ as a file historically called Docker.raw (older or differently configured setups may show Docker.qcow2). That single file is a container for all your images, stopped containers, named volumes, and the build cache.
Here is the part that surprises people: this file only ever grows. When you delete an image inside Docker, the space is freed inside the virtual disk, but the Docker.raw file on your Mac does not automatically shrink. So Finder and "About This Mac" keep reporting a huge file long after you cleaned up. That mismatch is why the fix is a two-step process: first prune the junk inside Docker, then let Docker compact the file.
Reclaim space with docker prune
Docker ships a built-in cleanup command. The safest starting point is a targeted prune that only removes things Docker considers clearly unused. Open Terminal and run:
- docker system df — shows how much space images, containers, volumes, and the build cache each occupy, plus how much is reclaimable. Always start here so you know what you are dealing with.
- docker container prune — removes stopped containers only. Running containers are untouched.
- docker image prune — removes dangling images (untagged layers left over from rebuilds).
- docker builder prune — clears the build cache, which is often the single biggest offender on machines that rebuild images frequently.
For a deeper sweep, docker system prune combines several of these. Be aware that adding --all removes every image not currently used by a container, and adding --volumes removes unused named volumes — which can contain database data you wanted to keep. Read the confirmation prompt before you type y. If you are unsure, prune images and build cache first, and leave volumes for last.
A quick note on volumes
Named volumes are where Docker keeps data you usually want to survive a container restart, such as a local Postgres database. Pruning them is permanent and does not go through the macOS Trash. Only prune volumes you are certain you no longer need, and consider backing up important data first.
Shrink the Docker.raw file
After pruning, run docker system df again. You will often see gigabytes marked as reclaimed inside Docker — but the on-disk file may still look large until Docker compacts it. On current Docker Desktop with the VirtioFS/Apple Virtualization backend, this compaction usually happens automatically in the background after a prune, and quitting and reopening Docker Desktop can help trigger it.
If the file stubbornly stays large, the most reliable manual reset is to open Docker Desktop → Settings → Troubleshoot (the bug icon) and choose Clean / Purge data, or Reset to factory defaults. This rebuilds the virtual disk from scratch and returns the space immediately. The trade-off is that it removes all images, containers, and volumes, so you will re-pull and rebuild afterward. Treat it as the nuclear option once ordinary pruning has done its job.
Keep it from filling up again
A few habits keep Docker's footprint in check: run docker builder prune every week or two if you build often, use docker compose down rather than just stopping containers when you finish with a project, and cap Docker's maximum virtual disk size under Settings → Resources so it can never balloon past a limit you choose.
A quick word on safe cleaning and privacy
Everything above uses Docker's own commands, which is exactly the safe path: you preview what will be removed with docker system df, and you act deliberately. That is the same principle worth applying to the rest of your Mac. Good cleanup tools show you a preview first, default to only user-level junk like caches and logs, and send removals to the Trash so they stay reversible — nothing is permanently deleted until you empty it. A cleaner also has no reason to phone home; if you want to verify that, a firewall like Little Snitch will show you exactly what an app tries to contact.
If you want that approach for general Mac cleanup, CoreSweep is our top free pick: free forever, with an optional one-time Pro license ($49, no subscription), reversible Trash-based deletes, and zero telemetry. A strong value runner-up is SkoonMac, which is free with a one-time $19 Pro upgrade. Both leave the deep, developer-specific cleanup like Docker to purpose-built commands, which is exactly how it should be.
Reclaiming Docker space comes down to two moves: prune what you no longer need, then let the virtual disk compact. Do that periodically and you will keep tens of gigabytes free without ever risking a project.
Frequently asked questions
Why is Docker using so much space on my Mac?
On macOS, Docker Desktop keeps all your images, stopped containers, named volumes, and build cache inside a single virtual disk image (historically called Docker.raw) under ~/Library/Containers/com.docker.docker. That file only ever grows as you build and pull, so a busy dev machine can hand Docker 40 to 100 GB over a few months. Almost all of it is reclaimable with Docker's own prune commands.
Does deleting Docker images actually free up space on my Mac?
Not right away. When you remove an image or container, the space is freed inside Docker's virtual disk, but the on-disk Docker.raw file does not automatically shrink, so Finder and About This Mac keep reporting a large file. That is why reclaiming space is a two-step process: prune the junk inside Docker first, then let Docker compact the file (often automatic on recent versions, and quitting and reopening Docker Desktop can help trigger it).
Is docker system prune safe, or can it delete data I need?
Plain pruning of stopped containers, dangling images, and the build cache is safe and only removes things Docker considers clearly unused. The risk is the --volumes flag: named volumes can hold data like a local Postgres database, and pruning them is permanent and does not go through the macOS Trash. Run docker system df first to see what will be reclaimed, prune images and build cache before volumes, and back up any volume data you care about.
The easy way to do this safely
If you'd rather not do it by hand, the two cleaners we rate highest run with a preview first and the Trash as a safety net — and neither sends any data off your Mac.
CoreSweep (free to use; Pro a one-time $49) is our top pick. SkoonMac (free; Pro $19 once) is the best-value runner-up. See the full comparison.