# Docker.raw looks huge on Mac: how to see the real size and reclaim space

_Updated 2026-10-21_

> **Quick answer:** do not delete `Docker.raw`. Its size in Finder is often misleading because it is a sparse file. Check the real usage with `du -h`, then free space with `docker system prune` and `docker builder prune`.


## Where it lives

Docker Desktop for Mac keeps all images, containers, volumes and build cache inside one virtual disk file. On current versions it is here:

```
~/Library/Containers/com.docker.docker/Data/vms/0/data/Docker.raw
```

Older versions used a differently named disk image, but the idea is the same: everything Docker stores on your Mac is in that one file.


## Why it can look gigantic and still be small

`Docker.raw` is a **sparse file**. Its apparent size is the limit the virtual disk can grow to, not the space it takes today. On a test Mac the two commands below disagreed by two orders of magnitude:

```
ls -lh ~/Library/Containers/com.docker.docker/Data/vms/0/data/Docker.raw
du -h  ~/Library/Containers/com.docker.docker/Data/vms/0/data/Docker.raw

# ls  ->  460G   (apparent size, the maximum)
# du  ->  1.9G   (space really used on disk)
```

macOS Storage settings and disk-usage tools count the real figure, so a Docker.raw that Finder lists as hundreds of gigabytes may be costing you only a couple.


## Check what is really using the space

```
docker system df
docker system df -v
```

The first command summarises images, containers, volumes and build cache and shows how much of each is reclaimable. The second lists every item.


## Reclaim space, safest first

- **Build cache:** `docker builder prune`. Safe, it only makes the next build slower.
- **Dangling images:** `docker image prune`. Safe. Add `-a` to remove every image not used by a container; you will download them again when needed.
- **Stopped containers:** `docker container prune`.
- **Everything unused at once:** `docker system prune` removes stopped containers, unused networks, dangling images and build cache. Add `-a` for all unused images.
- **Volumes:** `docker volume prune` removes volumes no container uses. This can delete database and application data. Run `docker volume ls` first and only prune volumes you are sure about.


## Shrink the disk image itself

In Docker Desktop open **Settings → Resources** to set the disk image size limit, and **Troubleshoot** for the Clean and Purge data option. Purge deletes all Docker data, so use it only when you really want a clean start. After pruning, the file may not shrink immediately; Docker Desktop returns the space to macOS gradually, and a restart of Docker Desktop can speed that up.


## What not to do

- Do not delete `Docker.raw` by hand, and never while Docker Desktop is running.
- Do not use `docker system prune -a --volumes` unless you are certain nothing valuable lives in a volume.
- Do not reset Docker Desktop to factory defaults before you have exported what you need.

[See Your Disk](/) shows Docker's disk image on the map with its real size, and marks it Protected: it is shown but never removed, with a pointer to Docker's own cleanup. More on that in [how See Your Disk cleans](/guides/how-see-your-disk-cleans/).

Get See Your Disk: [Mac App Store](https://apps.apple.com/us/app/clean-systemdata-seeyourdisk/id6817565741) · [GitHub](https://github.com/bikmeev/see-your-disk)

## Frequently asked questions

**Is it safe to delete Docker.raw?**
Only if you accept losing everything inside it: all images, containers and volumes. Never delete it while Docker Desktop is running. If you want to start fresh, use Docker Desktop's Troubleshoot menu instead of deleting the file by hand.

**Does docker system prune delete my databases?**
Not by default. Volumes are kept unless you add the --volumes flag, and that is where databases usually live. Check `docker volume ls` before you remove any volume.

**Why does Finder show a much bigger size than macOS Storage?**
Docker.raw is a sparse file. Its apparent size is the maximum the virtual disk may grow to, while the space actually used on your disk is usually far smaller. Get Info shows both figures.

**Why did the file not shrink after pruning?**
Pruning frees space inside the virtual disk, and Docker Desktop hands it back to macOS over time rather than at once. Restarting Docker Desktop can help.

## Related guides

- [How to clear System Data on Mac safely](https://seeyourdisk.com/guides/how-to-clear-system-data-on-mac/)
- [How to clear Xcode DerivedData (and other Xcode leftovers) on Mac](https://seeyourdisk.com/guides/clear-xcode-derived-data-mac/)
- [How See Your Disk cleans: methods and safety levels](https://seeyourdisk.com/guides/how-see-your-disk-cleans/)
