Help · Mac storage

Docker using too much disk space?

Docker Desktop keeps every image, container, volume and build cache inside one virtual disk on your Mac. It grows as you pull and build, and doesn't shrink by itself. The fix is to clean up inside Docker. Deleting its files in Finder breaks Docker.

Why Finder's number looks wrong

The disk image, Docker.raw, is a sparse file. Finder may show its maximum size, not the space it really uses. Docker's documentation suggests checking the real size in Terminal, in the folder that holds it:

cd ~/Library/Containers/com.docker.docker/Data/vms/0/data
ls -klsh Docker.raw

The first number is the space actually used. Docker also shows the image's location, its size limit and current use in Settings › Resources › Advanced.

1. See what's using it

docker system df -v

It lists images, containers, volumes and build cache, and how much of each is reclaimable.

2. Remove what's unused

docker system prune

This removes stopped containers, unused networks, dangling images and build cache, after asking you to confirm. It's permanent. A stopped container's data goes with it. By default it leaves volumes alone. Docker notes it can take a few minutes for the space to show up on your Mac.

To be more targeted, Docker also has docker image prune, docker container prune and docker builder prune.

3. Start fresh

In Docker Desktop's Troubleshoot menu, Clean / Purge data (Clean up data in newer versions) deletes all containers and images but keeps your settings. Push or export anything you need first.

4. Cap or move the disk image

In Settings › Resources › Advanced, you can lower the Disk usage limit (called Disk image size in older versions). Docker warns this deletes the current image, including all containers and images. To keep it on an external drive, change the disk image location there, never by moving the file in Finder.

Done with Docker altogether? See how to uninstall Docker Desktop.

Run Docker's own clean-up from one list.

Pangalin Space Manager finds Docker's disk image (marked Caution, with Docker's own steps), and its Janitors can run docker system prune -f for you while Docker is running. The confirmation says plainly that it deletes permanently, and that Docker does the removing. Named volumes are never touched. Janitors need a licence, because the space they free can't be measured in advance.

Free to scan · first 5 GB freed free, then $25 a year · 14-day full refund · Notarised by Apple