Docker taking up too much space on Mac
Short answer
Docker Desktop for Mac keeps all images, containers, volumes and build cache inside one disk image file, which grows as you use Docker. To reclaim space, see what is using it with docker system df, then remove what is unused with docker system prune. Add -a to also remove images no container is using. Do not delete the disk image file by hand: that removes everything, including volumes.
Where Docker stores data on a Mac
Docker Desktop runs a small Linux virtual machine, and everything Docker stores sits in that machine’s disk image:
~/Library/Containers/com.docker.docker/Data/vms/0/data/Docker.raw
The file is sparse, so Finder can show a size far larger than what it really uses. To see the real figure:
du -h ~/Library/Containers/com.docker.docker/Data/vms/0/data/Docker.raw
See what is using the space
docker system df
This shows the space used by images, containers, local volumes and build cache, and how much of each is reclaimable. Add -v for a line-by-line list.
Reclaim space safely
Work down this list and stop when you have enough space back.
| Command | Removes | Risk |
|---|---|---|
docker builder prune | Build cache | None. Next builds are slower. |
docker container prune | Stopped containers | You lose anything written inside those containers. |
docker image prune | Dangling images (untagged) | None. |
docker image prune -a | Every image not used by a container | Images are pulled or built again when needed. |
docker system prune | Stopped containers, unused networks, dangling images, build cache | Low. |
docker volume prune | Unused anonymous volumes (add -a for named ones) | High. Volumes hold database data that cannot be rebuilt. |
Careful: docker system prune -a --volumes does all of the above at once. Check docker volume ls first, and do not run it if a stopped container owns data you need.
If the disk image does not shrink
Docker Desktop hands freed space back to macOS, but it can take a little while after a prune. If the file is still large:
- Restart Docker Desktop and check again with
du -h, not Finder. - Lower the disk limit in Docker Desktop → Settings → Resources. Reducing the limit deletes the disk image and everything in it, so only do this if you can rebuild or pull everything again.
- To start completely fresh, use Troubleshoot → Clean / Purge data in Docker Desktop. This removes all images, containers and volumes.
Colima
Colima keeps its virtual machine disks in ~/.colima. The same docker prune commands work. To remove a Colima machine and its disk entirely:
colima delete
See Docker next to your other developer files
iClearer’s Builders screen lists Colima and Docker folders in your home folder with their sizes, labelled Ask first because they can hold data that cannot be rebuilt. For Docker Desktop’s disk image, use the Docker commands above. iClearer also clears the caches that sit beside Docker on most developer Macs: Xcode DerivedData, npm, pnpm, Yarn, pip, Homebrew and Gradle.
Scanning is free on every Mac and the free plan includes 500 MB of cleanup. Unlimited cleanup starts at $29.99 per year for one Mac, with a 14-day money-back guarantee. Needs macOS 13 Ventura or later, Intel or Apple silicon.Frequently asked questions
Why is Docker taking up so much space on my Mac?
Docker Desktop stores every image, container, volume and build cache layer in one disk image file, and the file grows as you pull and build. Old images and build cache are usually the largest part. Run docker system df to see the breakdown.
Is it safe to run docker system prune?
Yes for most setups. It removes stopped containers, unused networks, dangling images and build cache. It does not remove volumes or tagged images unless you add --volumes or -a.
Where is Docker.raw on a Mac?
In ~/Library/Containers/com.docker.docker/Data/vms/0/data/Docker.raw. It is a sparse file, so Finder may show its maximum size. Run du -h on the file to see how much disk space it really uses.
Can I delete Docker.raw?
Only if you want to lose everything in Docker. Deleting the file removes all images, containers and volumes. Use docker system prune, or Clean / Purge data in Docker Desktop, instead.
Does docker system prune delete volumes?
No, not by default. Volumes are only removed if you add the --volumes flag or run docker volume prune. Volumes often hold database data, so check docker volume ls before removing them.
Related guides
- Free up disk space on a Mac for developersReclaim tens of gigabytes on a developer Mac. Safe commands to clear Xcode DerivedData, npm, pnpm, pip, Homebrew, Docker, simulators and AI model caches.
- How to delete Xcode DerivedDataXcode DerivedData can grow to tens of gigabytes. It is safe to delete. See where it is, three ways to clear it, and what else Xcode leaves on your disk.
- How to clear npm cache and node_modules on MacFree up disk space from Node.js on a Mac: clear the npm, pnpm, Yarn and Bun caches, find and delete old node_modules folders, and remove old Node versions.