Docker taking up space on your Mac: how to get it back
By Chris WilliamsUpdated 6 min read
Short answer: Docker Desktop keeps every image, container, volume and build cache in one disk image, Docker.raw. See what's in it with docker system df, then reclaim space with docker system prune, adding -a for unused images. Prune volumes only when you know what's in them, and don't delete Docker.raw in Finder.
On this page
- Why Docker takes so much space on a Mac
- Where Docker.raw is, and why Finder shows the wrong size
- See what's using Docker's space
- Free up space with docker system prune
- Prune by age to keep recent work
- Volumes: the part to be careful with
- Can you delete Docker.raw?
- OrbStack and Colima
- Removing Docker completely
- What's safe to remove, and what isn't
- How MacClearings handles Docker
Why Docker takes so much space on a Mac
Containers need a Linux kernel, so Docker Desktop on a Mac runs them in a small virtual machine. That machine's disk is a single file. Docker's documentation puts it this way: Docker Desktop "stores Linux containers and images in a single, large 'disk image' file" (Docker Docs).
Everything lands in that one file:
- Images you've pulled or built, including old versions you no longer run
- Stopped containers, each with whatever it wrote to its filesystem
- Volumes, which is where databases and other containers keep data meant to last
- Build cache from
docker build, which grows with every build
None of it goes away on its own. Delete files inside a running container and the disk image doesn't shrink: Docker's FAQ says space is freed only when images are deleted, not when files are deleted inside running containers.
…/Docker.raw
Docker disk image
- Made by
- Docker Desktop
- What it is
- The disk Docker Desktop's virtual machine uses for all your images, containers and volumes.
- Does it come back?
- Doesn't come back
- Without it
- Every container, image and volume would go with it, including data in volumes you haven't backed up.
- How to manage it
- Docker Desktop → Settings → Resources, or docker system prune
Where Docker.raw is, and why Finder shows the wrong size
By default the file is here:
~/Library/Containers/com.docker.docker/Data/vms/0/data/Docker.raw
shows the disk image location and lets you move it. Docker warns not to move the file in Finder, because Docker Desktop can lose track of it.
Finder and many other tools show the file's maximum size, not what it actually uses on disk. To see the real figure, Docker suggests:
ls -klsh ~/Library/Containers/com.docker.docker/Data/vms/0/data/Docker.raw
The first number is the space it really occupies. The size further along the line is the maximum. If you're comparing Docker against what macOS says is full, use the first number. When numbers don't agree, our guide to Mac storage that doesn't add up explains other common causes.
See what's using Docker's space
With Docker running:
docker system df
It shows how much space images, containers, local volumes and build cache use, and a RECLAIMABLE column with what pruning could free (Docker Docs). For a per-image and per-volume breakdown:
docker system df -v
Free up space with docker system prune
See what's using the space
With Docker running, run docker system df in Terminal. The RECLAIMABLE column shows what pruning could free.
Prune what nothing uses
Run docker system prune. It removes stopped containers, unused networks, dangling images and build cache, after asking you to confirm.
Remove unused images too
If you're happy to pull or build images again, run docker system prune -a to remove every image no container uses.
Review volumes before pruning them
Run docker volume ls and check what each volume holds. docker volume prune removes unused anonymous volumes; add -a to include named ones.
Give Docker a few minutes
Docker Desktop returns the freed space to macOS after a short delay. Run docker system df again to confirm.
The commands, in order from gentlest to broadest:
docker system prune
docker system prune -a
The first removes stopped containers, unused networks, dangling images and build cache. The second also removes every image that no container uses. Both ask for confirmation first, and -f skips that (Docker Docs).
To clear only the build cache, which is often the largest part for people who build images all day:
docker builder prune
Pruning is permanent. Pruned images can be pulled or built again, but a stopped container's own changes are gone, and Docker has no Trash or undo for any of it.
Space comes back to macOS a little later. Docker's FAQ notes it "might take a few minutes to reclaim space on the host."
Prune by age to keep recent work
If you don't want to lose images and containers you made this week, add an age filter. The until filter takes durations such as 24h, measured from now, and only removes containers, images and networks created before then (Docker Docs):
docker system prune -a --filter "until=168h"
That removes unused images and stopped containers older than a week. Running it every so often keeps the disk image from creeping up without wiping out what you're working on. Build cache is the part that grows fastest for people who build images all day, and docker builder prune clears it on its own without touching images.
Volumes: the part to be careful with
Volumes hold data that's meant to outlive containers: a local Postgres database, uploaded files, a cache you spent an hour filling. That's why docker system prune leaves them alone unless you add --volumes, and even then it only removes anonymous volumes.
Look before you prune:
docker volume ls
docker volume prune
docker volume prune removes unused anonymous volumes. Adding -a also removes named volumes that no container uses (Docker Docs). A named volume for a database you stopped last week counts as unused. If it matters, back it up or start its container before pruning.
Can you delete Docker.raw?
Deleting Docker.raw removes every image, container and volume at once. If that's what you want, use Docker Desktop's own reset rather than Finder: open Troubleshoot from the Docker menu and choose Clean up data. Docker describes it as a disk image reset that "destroys all Docker containers and images local to the machine, preserving all settings" (Docker Docs).
The disk limit in sets the most space the disk image can use. Lowering it isn't a way to shrink a full image: Docker's FAQ warns that reducing the maximum size deletes the current disk image file, with everything in it.
To shrink Docker.raw without losing data, prune and wait. The file's real size drops as Docker hands the freed space back.
OrbStack and Colima
If you use OrbStack or Colima instead of Docker Desktop, the same docker commands work, because both provide the Docker engine. The disk image lives elsewhere and is managed a little differently.
- OrbStack keeps its data in
~/.orbstack. Its documentation says disk usage "increases and decreases as needed" (OrbStack Docs), so space you prune comes back to macOS. - Colima keeps its virtual machines under
~/.colima. Its FAQ says space freed withdocker system pruneis released when Colima starts, from version 0.5.0 on, so runcolima stopandcolima startafter pruning.colima delete --dataremoves all container data (Colima FAQ).
Removing Docker completely
If you don't use Docker anymore, uninstall it with its own uninstaller, which removes the disk image too. In Docker Desktop, open Troubleshoot and choose Uninstall, or run:
/Applications/Docker.app/Contents/MacOS/uninstall
Then move Docker.app to the Trash. Docker's documentation lists two leftovers to remove yourself: ~/Library/ and ~/.docker (Docker Docs). Uninstalling destroys all local images, containers and volumes, so back up any volume you need first. For other apps, see how to uninstall apps completely.
What's safe to remove, and what isn't
Safe, with Docker's own commands:
- Dangling images and build cache (
docker system prune) - Images no container uses (
docker system prune -a). You'll pull or build them again when needed. - Stopped containers you don't need
Check first:
- Volumes. They can be the only copy of a database or uploads.
- Stopped containers you might restart. Their changes are lost when pruned.
Don't:
- Delete or move
Docker.rawin Finder - Lower the disk limit to "shrink" it, which deletes the disk image
- Delete files inside
~/Library/by handContainers/ com.docker.docker
How MacClearings handles Docker
MacClearings shows Docker's disk image and stops there. Its Docker rule is report-only: it lists the size of Docker Desktop's disk image, and of OrbStack's and Colima's if you use them, and never stages them for the Trash.
Suggestions rule · Docker
Docker disk image
Docker keeps images, containers and volumes in one disk image. MacClearings only reports its size. Use Docker's own prune command to reclaim space safely.
- ~/Library/Containers/com.docker.docker/Data/vms/0/data
- ~/.orbstack/data
- ~/.colima/_lima
Reported only. MacClearings shows the size and never moves it.
The reason is the same one this guide keeps coming back to. One file holds every image, container and volume. Moving it to the Trash would take all of them at once, including volumes that might be your only copy of something. Docker's own commands know which images and containers are in use, so the rule links to Docker's prune documentation instead of offering a checkbox. Don't move Docker.raw yourself either.
Elsewhere in MacClearings, Breakdown lists Docker Desktop's data among app containers in your Library, with a note to manage it in Docker Desktop. The Map's inspector explains Docker.raw, OrbStack's and Colima's folders with the field guide entries quoted above.

Everything MacClearings can move, like package manager caches or old project build folders, goes to the Trash only after you review it, and every cleanup can be undone from History. MacClearings never empties the Trash, so that space comes back when you empty it. The developer page lists every developer rule, including this one.
Questions
Why is Docker taking so much space on my Mac?
Docker Desktop runs containers in a Linux virtual machine whose disk is one file, Docker.raw. Every image you pull or build, every stopped container, every volume and the build cache live inside it, and it grows until you prune what you don't use.
How do I free up space from Docker?
Run docker system df to see what's reclaimable, then docker system prune. Add -a to remove all unused images, not only dangling ones. Volumes aren't pruned unless you ask, because they can hold data like databases.
Can I delete the Docker.raw file?
Only if you're willing to lose every image, container and volume in it. Docker's own way to start fresh is Troubleshoot > Clean up data in Docker Desktop, which resets the disk image and keeps your settings. Don't delete or move Docker.raw in Finder.
How do I shrink a Docker.raw file?
Prune images, containers and build cache, then wait a few minutes: Docker Desktop releases the freed space to macOS. Finder may still show a large size, because it reports the file's maximum size. ls -klsh Docker.raw shows the space it really uses.
How do I fully remove Docker from a Mac?
In Docker Desktop, open Troubleshoot and choose Uninstall, or run /Applications/Docker.app/Contents/MacOS/uninstall. Then move Docker.app to the Trash and remove ~/Library/Group Containers/group.com.docker and ~/.docker. Uninstalling destroys all local images, containers and volumes.
Related guides
- How to delete node_modules safely, in one project or all of themIs it safe to delete node_modules? How to delete it in one project or recursively across all of them, find the biggest first, use npkill, and reinstall later.
- Homebrew cleanup: free space with brew cleanup and autoremoveWhat brew cleanup actually removes, how to clear the Homebrew cache with --prune=all, remove old versions, and uninstall unused packages with brew autoremove.
- Mac storage full for no reason? Why the numbers don't add upWhy Mac storage looks full for no reason, and why Finder, System Settings, Disk Utility and Terminal disagree: purgeable space, snapshots, clones and more.
- How to uninstall apps on a Mac completelyUninstall Mac apps with Finder, Launchpad or Apps, then find the files they leave in your Library. Steps for macOS 15, 26 and 27, and what's safe to remove.