Dustloft

Docker.raw is taking up hundreds of GB on your Mac — here is why

Technical · 5 min read · Updated September 2026

Short answer: Docker.raw is a sparse file, so its apparent size and the space it actually occupies are different numbers. Use du -h, never ls -lh, to see the truth. Run docker system prune -a to reclaim, which never touches your volumes.

On one Mac, Docker.raw reported 494 GB — larger than the entire 494 GB drive. It was actually occupying 9.3 GB.

Why the two numbers differ

Docker Desktop stores its Linux VM disk as a single sparse file. A sparse file has an apparent size — how large it claims to be — and an allocated size, the blocks genuinely written to disk. Unwritten regions cost nothing.

The two commands disagree, and only one is useful:

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

ls -lh "$P"   # apparent size  — 494 GB, misleading
du -h  "$P"   # allocated size — 9.3 GB, the truth

This is why disk tools disagree about Docker. Anything reading apparent size reports an absurd number; anything reading allocated blocks reports reality.

The opposite problem

Sparse files grow but do not automatically shrink. Delete 100 GB of images inside the VM and the file often stays the same size on your Mac, because the blocks were written once and never released. This is the more common complaint: Docker reports 20 GB of images while Docker.raw occupies 300 GB.

Reclaiming it properly

# What is actually reclaimable
docker system df

# Remove unused images, stopped containers and build cache
docker system prune -a

prune -a removes every image not used by a running container, plus stopped containers and build cache. It does not remove named volumes, which is where database data lives. Do not add --volumes unless you are certain.

After pruning, Docker Desktop usually TRIMs the disk and the file shrinks on its own. On the machine above, Docker.raw went from 23 GB to 8.8 GB shortly after a prune.

If it does not shrink

Docker Desktop → Settings → Resources has a disk image size limit. Lowering it forces a rebuild of the file at the smaller size. The nuclear option — deleting Docker.raw — destroys every image, container and volume, so treat it as a last resort.

Preventing it

Docker's disk image defaults to a maximum near the free space available at install time, which on a large drive can be hundreds of gigabytes. Setting an explicit ceiling in Settings → Resources caps how far it can grow.

If you would rather see this measured alongside everything else on your disk, Dustloft reports allocated size rather than apparent size for exactly this reason, and offers a Docker prune that never touches volumes.

See exactly what is on your own disk

Dustloft measures every real consumer of space on your Mac and shows each item with its full path and size before anything is removed. Free, open source, no subscription.

Install Dustloft

Docker is rarely the only offender on a developer machine. Dependencies and build output and Xcode leftovers usually cost more.