Docker Desktop Using Too Much Space on Your Mac? How to Reclaim It
Find out what is inside Docker Desktop's virtual disk, clear build cache, images, and containers with Docker's own commands, and keep your volume data safe.
Published 2026/10/29By WashBear Team
On a Mac, Docker Desktop keeps images, containers, volumes, and build cache inside a single virtual disk file. In Finder you only see an ever-growing Docker.raw, with no hint of what is inside. The key to reclaiming space is to sort things out inside Docker first, separating cache you can rebuild from data you need, and then clean up with Docker's own commands instead of touching that file.
Where Docker's space goes
Docker Desktop runs containers in a lightweight virtual machine. By default the VM's disk is the file below, and Settings → Resources → Advanced shows its actual location. It is a sparse file: some tools, such as ls -l, report its maximum size, while du shows how much space it really uses.
# Actual space used by Docker's virtual disk
du -h ~/Library/Containers/com.docker.docker/Data/vms/0/data/Docker.raw
# Usage inside Docker by type; Docker must be running
docker system df
# Per-item details for images, containers, volumes, and build cache
docker system df -v
docker system df reports four rows: Images, Containers, Local Volumes, and Build Cache. The RECLAIMABLE column is Docker's estimate of what could be freed. Find the biggest row first, then decide where to start.
What is safe to delete, and what needs care
| Type | What it is | Can you delete it? |
|---|---|---|
| Build cache | Layers and intermediate results left by docker build | Yes; the next build is slower and may download dependencies again |
| Dangling images | Old untagged layers that no other image references | Yes |
| Unused images | Images no container currently uses | Usually; pull them again when needed. Check first for images you built locally and never pushed |
| Stopped containers | Containers that stopped but were never removed | Check first that they hold no files or state you need |
| Volumes | Persistent data such as databases and uploads | Treat them as data; do not bulk-delete them to save space |
Warning
Do not delete or move Docker.raw directly, and do not lower the disk image's maximum size just to make the number smaller. According to the Docker Desktop documentation, lowering the limit deletes the existing disk image along with all containers and images. To relocate it, change the location in settings rather than dragging the file in Finder.
Reclaim space with commands
Run these commands while Docker is running. Without -f, Docker lists what it is about to remove and waits for your confirmation.
Build cache
# Remove dangling build cache
docker builder prune
# Remove all unused build cache
docker builder prune --all
# Remove only unused build cache older than 7 days
docker builder prune --all --filter until=168h
Build cache is usually the best place to start, because images, containers, and volumes are untouched. See the docker builder prune reference for more options.
Images and stopped containers
# Remove all stopped containers
docker container prune
# Remove dangling images
docker image prune
# Remove every image no container uses; frees the most, but you pull again when needed
docker image prune -a
Volumes
docker volume ls
# By default removes only unused anonymous volumes; named volumes are kept
docker volume prune
Only --all also removes unused named volumes. Named volumes often hold database data, so check them one by one and back up when in doubt.
What a one-step cleanup covers
docker system prune removes stopped containers, unused networks, dangling images, and unused build cache in one go. Adding -a also removes every image without a container, and --volumes removes unused anonymous volumes. It is convenient but broad, so read the list Docker prints before you confirm.
Confirm that your Mac actually got space back
After cleaning, run docker system df again and check Docker.raw with the du command above. Docker notes that returning space to macOS can take a few minutes. If Docker is already lean and your disk is still full, look at other folders next.
Clean up with WashBear
WashBear's Deep Cleanup offers two Docker Desktop items under Container caches:
- Docker build cache: during the scan, WashBear reads the build cache Docker reports as unused and not shared with an image, and estimates its size. Cleanup runs
docker --context default builder prune --all --force; images, containers, networks, and volumes are kept. Docker must be running, otherwise the item does not appear, and Smart recommendation never preselects it. After cleanup, WashBear reads Docker's numbers again and reports the difference as the amount removed. - Docker Desktop old logs: host and virtual machine diagnostic logs older than seven days. The item is marked Low risk and preselected by Smart recommendation. Docker Desktop must be closed first, and the last seven days of logs are kept.
Tip
These two items need Docker in opposite states, so handle them in two passes: clear the build cache while Docker is running, then quit Docker Desktop and clear the old logs.
WashBear always uses the default context; it does not follow DOCKER_HOST or another context you switched to. Images, containers, volumes, Docker.raw, and custom Buildx builders are outside its scope, so manage those with the commands above. Cleanup takes effect immediately and cannot be undone, and the result is recorded in Operation History.
Not sure whether Docker is what is filling your disk? Open the Containers folder in your Library with Disk Space Analysis and see how big com.docker.docker is. To try it on your own Mac, download WashBear; scanning and analysis never delete anything by themselves. The demo below uses sample data and is only illustrative.
Disk Space Analysis
11 folders · 1,435,775 files
FAQ
Will clearing build cache delete my images?
No. docker builder prune only touches build cache; images, containers, and volumes are kept. The cost is that your next build reruns steps that used to hit the cache.
Docker showed a lot of reclaimable space, so why did my free space barely change?
Returning space from the virtual disk to macOS takes a little while, so check again after a few minutes. Also, RECLAIMABLE is only an estimate; data still used by a container or shared with other objects is not removed.
How do I wipe everything and start over?
Open Troubleshoot from the Docker menu and use Clean up data. It resets the disk image and deletes every local container and image along with the data inside them, while keeping your settings. Use it only when you are sure you need none of your local Docker data.
Related articles
Developer cleanupPublished 2026/10/29
How to Bulk-Clean node_modules, target, and build Folders in Old Projects
Find regenerable dependency and build folders in old projects, clean them in bulk with commands or WashBear, and keep virtualenvs and tracked files safe.
Developer cleanupPublished 2026/10/29
How to Clear npm, pnpm, and Yarn Caches Without Breaking Your Projects
Tell global package caches apart from node_modules, clear npm, pnpm, and Yarn caches with their official commands, and avoid a few common traps.
Developer cleanupPublished 2026/10/29
Xcode Taking Up Tens of Gigabytes? How to Clear DerivedData, Simulators, and Device Support
See where Xcode's storage goes, which DerivedData, simulator runtimes, devices, and device support files you can delete, and what you should keep.