Docker.raw: Why is my Mac out of space when Docker is empty?
Docker on Mac has a dirty secret.
You run docker system prune -a. You see "Reclaimed 20GB". You check your Mac's "About This Mac" storage... and nothing changed. You still have 0GB free.
Why? The answer lies in how Docker Desktop for Mac handles virtualization.
The "Sparse File" Trap
Docker for Mac runs a Linux Virtual Machine (VM). All your images, containers, and volumes are stored inside a single massive file on your Mac, usually located at:
~/Library/Containers/com.docker.docker/Data/vms/0/data/Docker.raw
When you tell Docker to allocate "64GB" of disk size, it creates this file. macOS (and APFS) treats this as a sparse file. It starts small and grows as you add data.
However, it rarely shrinks.
When you delete a 5GB container inside Linux, the file system inside the VM marks that space as free. But the Docker.raw file outside (on your Mac) often keeps hold of that allocated space, expecting you to use it again soon.
How to Actually Reclaim the Space
Method 1: The "Nuke and Pave" (Fastest)
If you can afford to lose ALL your local images and volumes, the easiest way to reset the file size is inside Docker Desktop:
- Open Docker Desktop Dashboard.
- Go to Settings (gear icon).
- Go to Resources -> Disk image size.
- Move the slider (change the size slightly, e.g., from 64GB to 60GB).
- Click Apply & Restart.
Docker will delete the old .raw file and create a fresh, empty one. You immediately get your space back.
Warning: This will delete ALL your local Docker containers, images, and volumes (including local databases). Only do this if you can recreate your environment from zero.
Method 2: The CLI Prune (Maintenance)
To keep usage low without nuking everything, you must prune aggressively and regularly:
docker system prune -a --volumes
-a: Remove all unused images (not just dangling ones).--volumes: Use this carefully! It removes anonymous volumes.
Method 3: Visual Verification
Sometimes, you don't even realize Docker is the culprit. The Docker.raw file is hidden deep inside ~/Library/Containers.
DissectMac shines here. It shows Docker.raw as a single, massive rectangular block on your drive map.

Seeing a single 64GB file next to your 2GB project folder really puts things in perspective. It allows you to make an informed decision: "Do I really need to keep 30 versions of this postgres image, or would I rather have 20GB of free space?"
Don't let phantom virtualization files eat your SSD.
Continue Reading
Node_Modules Black Hole: Recursively Finding and Cleaning Projects
If you have 50 side projects, you have 50GB of dead dependencies. Learn how to recursively search your Mac for 'node_modules' folders and delete the ones you forgot about.
Docker and Xcode Are Eating Your SSD. Here's the Fix.
That Docker.raw file can grow to 60GB+. Your DerivedData keeps expanding. iOS Simulator caches pile up. Here's how to clean it all.
What is 'Other Volumes in Container'? (And Why It's So Large)
Confused by 'Other Volumes in Container' in Disk Utility? It's not a bug—it's APFS. Learn what it means and 3 ways to reclaim space →