Skip to content
86% off$349 $48.86code BF2026

Guides

Docker system prune not giving back disk space on Mac

Docker.raw still huge after docker system prune on Mac? See why the file doesn't shrink, how to check real usage, and how to reclaim space safely.

TroubleshootingUpdated 6 min read

On this page

You ran docker system prune, Docker said it reclaimed a lot of space, and your Mac's free space didn't move. ~/Library/Containers/com.docker.docker still shows something like 64 GB. This page explains where the space is and how to get it back.

The file in question is usually here:

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

Why docker system prune doesn't shrink Docker.raw

Docker.raw is one sparse file that acts as Docker's whole disk. Images, containers, volumes and build cache all live inside it. Pruning deletes things inside that virtual disk and marks those blocks free for Docker to reuse. The file on macOS doesn't automatically shrink to match.

A request on Docker's public roadmap describes the same behavior. It says prune cleans up the internal state of the disk, but the image on your OS stays the same size. One user in that request reported a Docker.raw of about 1 TB when roughly 100 GB would have been enough.

The common causes, most likely first:

  1. The file keeps its high-water mark. Docker used the space once, you pruned, and the file stayed large.
  2. Prune didn't remove what is using the space. A plain docker system prune leaves tagged images that no container uses, and it leaves volumes.
  3. Build cache. If you build images often, this is frequently the biggest item.
  4. You're reading the wrong number. A sparse file has an apparent size (the limit it can grow to) and an allocated size (what it takes on disk). I can't tell you which one your tool shows. Finder-style allocated sizes are the ones that matter for free space.

Step 1: Compare Docker's view with the file on disk

Both commands are read-only. Docker Desktop must be running for the first one.

bash
docker system df

This lists space used by images, containers, local volumes and build cache, and how much of each is reclaimable.

bash
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 shows the apparent size. du shows the space allocated on disk. If du shows about 64 GB, the file really takes that much of your Mac's storage. If ls is far bigger than du, the large number is only the size limit.

Then pick your path:

  • docker system df shows a lot reclaimable: go to Step 2.
  • docker system df is small but du is large: skip to Step 3.

If Terminal says "Operation not permitted" for the Containers path, allow the access prompt if macOS shows one. Otherwise open System Settings, search for "Full Disk Access" and add Terminal.

Step 2: Prune the right things inside Docker

Run these in order and check docker system df after each.

bash
docker system prune

Removes stopped containers, unused networks, dangling images and unused build cache. It asks first.

bash
docker builder prune

Clears build cache.

bash
docker system prune -a

Also removes every image not used by a container.

Volumes need a look first, because databases and other app data often live in them.

bash
docker volume ls
docker volume prune

docker volume prune removes unused volumes, and that data can't be recovered. Which volumes count as unused depends on your Docker version, so read the prompt before you confirm. Docker's documentation page on pruning unused objects explains each command.

Step 3: Ask Docker Desktop to give the space back

If docker system df looks small but du is still large, the free blocks are inside the disk and macOS doesn't see them.

  1. Open Docker Desktop and go to its Settings.
  2. Open Resources and look for the disk image options. Depending on your version, that is a disk usage or reclaim-space action, or a Disk image size setting.
  3. If your version has a reclaim or compact action, run it. Then run the du command from Step 1 again.
  4. If you only find a size setting, read Docker's warning before changing it. Lowering the limit can be a reset-level change, so back up volume data first.

Docker Desktop's labels change between releases, so check Docker's documentation for your version if these options look different.

Step 4: Reset the Docker disk (last resort)

A fresh disk image starts small again. The cost is everything inside the old one.

  1. Copy out what you need: data in volumes, and any image you can't pull or build again.
  2. In Docker Desktop, open the Troubleshoot menu and choose its clean or purge data option. Labels vary by version.
  3. After the reset, pull or rebuild only the images you actually use.

Quick reference

SymptomLikely causeFix
docker system df shows large reclaimable numbersPrune was too conservativedocker builder prune, docker system prune -a
Volumes take most of the spacePrune skips volumesReview with docker volume ls, then prune
du large, docker system df smallFree space is inside the disk imageDocker Desktop reclaim or size option
ls huge, du modestSparse file; big number is the limitNothing to fix; trust du
Nothing shrinks itDisk image keeps its sizeBack up, then reset

Don't trash Docker.raw

Docker.raw is the virtual disk itself. Trashing it deletes every image, container and volume inside, and the Trash frees nothing until you empty it. Shrink it through Docker, as above.

Checklist before you try again

  • Docker Desktop is running and docker system df works.
  • You noted the du -h size of Docker.raw before pruning.
  • You reviewed docker volume ls before any volume prune.
  • You backed up volume data you can't recreate.
  • You emptied the Trash if you removed other files while freeing space.

What Gigabroom does and doesn't do here

You don't need an app for this. Terminal and Docker Desktop are enough.

Gigabroom can help you spot the file and keep you from trashing it. In Developer Junk (⌘7), the Containers & VMs section lists a Docker Disk Image row. It is marked Review and report-only, so it can't be swept. The row offers Copy the command for docker system prune and Open Docker Pruning Guide. Gigabroom never trashes the Docker disk image and never runs prune for you. It can't compact Docker.raw either, so shrinking stays in Docker Desktop.

For the rest of your developer clutter, see cleaning developer junk and freeing disk space on a Mac for developers. Gigabroom is part of MacSuite, and you can try it free for 7 days.

If nothing works

Contact Docker support, or open an issue on Docker's GitHub repositories. Include your Docker Desktop and macOS versions, the output of docker system df, the ls -lh and du -h results for Docker.raw, and the options you saw under Settings > Resources.

text
Subject: Docker.raw doesn't shrink after docker system prune (macOS)

Docker Desktop version: [version]
macOS version: [version]

After running docker system prune (and docker builder prune), the file
~/Library/Containers/com.docker.docker/Data/vms/0/data/Docker.raw
still uses [X] GB on disk (du -h).

docker system df output:
[paste output]

Options I see under Settings > Resources: [list them]
What I tried: prune, builder prune, [reclaim/size option]

How can I reduce the size of Docker.raw without losing my volumes?

If your Mac's free space still isn't dropping after you delete other things, see Mac storage not going down after deleting files.

Common questions

Is it safe to delete Docker.raw myself?

No. It holds all your images, containers and volumes. Use Docker Desktop's own reset if you want a fresh, small disk.

Why does Finder show a different size than Docker?

Docker reports what is used inside its virtual disk. Finder and du report what the file occupies on your Mac. After pruning, the first drops and the second may not.

Does docker system prune delete volumes?

Not by default. Volumes need their own prune step, and that data can't be recovered, so check docker volume ls first.

Will the file shrink if I just wait?

Not reliably. If your Docker Desktop version has no automatic reclaim, the file keeps its size until you use a reclaim option or reset the disk.

Every app.
One purchase.