## Docker filling your Mac's disk? How to get the space back

Source: https://diskcity.app/guides/docker-disk-full-mac (updated 17 October 2026)

Docker Desktop on a Mac runs containers inside a small Linux virtual machine, and everything that VM stores (images, containers, volumes and build cache) lives in a single disk image file. That file grows as you work and doesn't shrink on its own when you delete things in Finder. Here's how to clean it from the inside.

### Find the file

The disk image is `Docker.raw`, under `~/Library/Containers/com.docker.docker/Data/vms/0/data/`. It's a sparse file, so Finder may show its maximum size rather than the space it actually takes. `ls -ls` shows the real usage in the first column:

```sh
ls -lsh ~/Library/Containers/com.docker.docker/Data/vms/0/data/Docker.raw
```

Don't delete this file to save space. It holds every image, container and volume, including any databases you run in Docker.

### See what's using the space

```sh
docker system df
```

This splits usage into images, containers, local volumes and build cache, and shows how much of each is reclaimable. Add `-v` for a per-item breakdown.

### Safe cleanups, safest first

1. Build cache: `docker builder prune`. Layers rebuild on your next build; the only cost is a slower first build.
2. Dangling images: `docker image prune`. These are untagged layers left behind by rebuilds.
3. Stopped containers: `docker container prune`. Check `docker ps -a` first if you keep stopped containers around on purpose.
4. All unused images: `docker image prune -a`. Removes every image not used by a container; they download again when you next need them.

Be careful with `docker volume prune` and with `docker system prune --volumes`: volumes hold data, such as a local Postgres database, and removing them deletes that data for good.

### Stop it growing back

Docker Desktop's Resources settings let you cap the size of the virtual disk. A lower limit forces you to prune sooner but keeps Docker from quietly taking over your Mac. Running `docker builder prune` now and then keeps the build cache in check.

### How DiskCity handles Docker

DiskCity is in development. It treats Docker's build cache and dangling images as rebuildable and cleans them with `docker builder prune` and `docker image prune`, never by touching files. The `Docker.raw` disk image itself is marked never-touch, so no plan will ever include it. [Join the waitlist](https://diskcity.app/) to hear when it launches.
