SpotlessOverviewFeaturesPricingCompareHelpGuidesSupport
Doolphin › Spotless › Guides › Docker is taking up space on Mac: how to reclaim it

Docker is taking up space on Mac: how to reclaim it

Published 2026-11-11

Docker Desktop stores every image, container, volume and build cache inside one virtual disk file on your Mac: ~/Library/Containers/com.docker.docker/Data/vms/0/data/Docker.raw. It starts small and grows with use, and it commonly sits at 20 to 100 GB. Pruning inside Docker is safe for images, stopped containers and build cache, because they can be rebuilt or pulled again. Volumes are different: they hold databases and files that nothing else has a copy of. And the file on your Mac may not get smaller after you prune, for reasons below.

Look at the file first

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

Docker.raw is a sparse file. ls -l and Finder's Size show the maximum it may grow to, which is often close to your entire disk. On the Mac used to check this guide, the size column said 228 GB while the allocated blocks in the first column, and du, said about 10 GB. The number that counts is the allocated one. In Finder, Get Info shows both: "Size" is the cap and "Size on disk" is real. Nearly every first-time reader panics over the cap.

See what is inside

Docker must be running for these. If the command is not found, Docker Desktop is not installed or its CLI is not on your path (the Mac checked here had no docker command, only the leftover data folder).

docker system df
docker system df -v

The first prints four rows, Images, Containers, Local Volumes and Build Cache, each with TOTAL, ACTIVE, SIZE and RECLAIMABLE columns. The second lists every image, container and volume with its size. RECLAIMABLE is what a prune would remove. Treat the image figure as approximate, because images share layers and the totals count them in a way that can add up to more than the disk used. The -v output shows a SHARED SIZE column for that reason.

Remove what is safe

Run these one at a time, from least to most destructive. Each deletion inside Docker is permanent. There is no Trash.

docker builder prune

Removes unused build cache. Next builds are slower once. Add -a to remove every unused image. Often the biggest reclaim for people who build images often.

docker container prune

Removes stopped containers. Their writable layer is lost. If you kept data inside a container and not in a volume, it is gone.

docker image prune
docker image prune -a

The first removes dangling images (untagged leftovers). The second removes every image that no container uses, including ones you pulled and will use tomorrow. The cost is bandwidth and time to pull again. Private registry images need you to be logged in to get them back.

docker system prune

Stopped containers, unused networks, dangling images and build cache, in one command. It leaves volumes alone unless you add --volumes.

Volumes: the part that loses data

docker volume ls
docker volume prune

Removes volumes that no container references. Since Docker Engine 23 it removes only anonymous volumes by default. Named volumes need docker volume prune -a. Either way, it deletes database files, uploaded media and anything else in them for good.

The trap: a volume attached to a stopped container is still "in use", so docker volume prune skips it. But docker system prune --volumes removes the stopped containers first and then the volumes they leave unreferenced, in one step. A local Postgres or MySQL container you stopped last week loses its data. The same happens with docker compose down -v. Run docker volume ls, and read the names, before you add --volumes to anything.

Why the file does not shrink

Pruning frees space inside the virtual disk. Whether your Mac gets that space back depends on Docker Desktop. Recent Docker Desktop versions on Apple silicon use the raw disk format and normally hand freed blocks back to macOS some time after the prune, though Docker does not promise when. Older installs used a Docker.qcow2 file that only grew. If you see that filename, you are on an old format, and the fix is an update, then reset.

If du still shows a large file after pruning and waiting, try these in order:

  1. Quit and restart Docker Desktop.
  2. Open Docker Desktop > Settings > Resources and check the virtual disk limit. Lower it only if the data inside fits.
  3. As a last resort, Troubleshoot > Clean / Purge data. This deletes all images, containers and volumes and resets the disk to empty. It cannot be undone.

Docker Desktop for Mac does not shrink the file smaller than the data inside it. To recover the space, you must remove data first.

Uninstalling Docker Desktop leaves the data behind

Dragging Docker to the Trash does not remove ~/Library/Containers/com.docker.docker. The Mac checked here had no Docker app and still held about 10 GB in that folder. If you no longer use Docker, and have confirmed there is nothing in the volumes you need, delete that folder yourself. Use the in-app uninstall or reset first on a Mac where Docker is still installed, since it also removes its helper tools and links.

Other runtimes put the disk elsewhere

RuntimeDisk locationProper way to remove
Colima~/.colimacolima delete
Lima~/.limalimactl delete NAME
OrbStack~/.orbstackOrbStack settings
Podman~/.local/share/containers/podman/machinepodman machine rm

The same prune commands apply once the machine is running. Deleting the machine's folder yourself skips the tool's own bookkeeping. Use its command.

Where Spotless fits

The Developer page in Spotless measures the Docker Desktop disk, Colima, Lima, OrbStack and Podman folders and labels them as managed by their own tool. For Docker, the commands on this page are the way to reclaim space. Spotless does not move these virtual disks to the Trash, and it cannot tell you which volumes hold data you need.

Keep going

More guides

Not connected yet