Docker.raw Is Huge on Mac: How to Shrink It Without Losing Data
The Silo Team · 6 min read · September 22, 2026
Why Docker.raw Grows Without Limit
Docker Desktop on macOS stores all its container data inside a sparse virtual disk image: Docker.raw. This file is located at:
~/Library/Containers/com.docker.docker/Data/vms/0/data/Docker.raw
The problem: sparse virtual disks grow to accommodate data but never automatically shrink. When you pull a 5 GB image, delete it, and pull another, Docker.raw grows to accommodate each one sequentially. The freed space inside the VM is not reclaimed to the host filesystem.
Step 1: Prune Everything Inside Docker
First, remove what you no longer need inside Docker:
# Remove stopped containers, dangling images, unused networks, volumes
docker system prune --volumes -f
# Remove all unused images (not just dangling)
docker image prune -a -f
# Remove all BuildKit cache
docker builder prune --all -f
# Check how much space Docker is actually using
docker system df -v
Step 2: Compact the Virtual Disk
After pruning, you need to tell the VM to compact the sparse disk:
# Quit Docker Desktop first, then:
# For macOS using virtualization framework
qemu-img convert -O qcow2 Docker.raw Docker.qcow2
# Or use Docker Desktop's built-in disk cleanup:
# Docker Desktop → Settings → Resources → Advanced → Virtual Disk Limit → Apply & Restart
Using MacPilot's Docker Companion
MacPilot shows you the actual vs. allocated size of Docker.raw in real-time via the Docker socket. When the delta exceeds a configurable threshold, it prompts you to run a safe prune. It also monitors container states, dangling volumes, and BuildKit cache accumulation — all without opening Docker Desktop's electron interface.
Colima and Podman Users
Similar sparse disk patterns affect Colima (~/.local/share/colima/default/docker.disk) and Podman machines. MacPilot detects all three runtime types and applies the same monitoring and cleanup logic.
Keep reading
How to Free Up Disk Space on Mac: The Developer's Complete Guide
From APFS clone-aware deduplication to DerivedData nukes and Docker.raw shrinking — the most complete storage reclaim guide for macOS engineers.
How to Clean node_modules & Build Caches Safely Without Corrupting Git or Losing Work
Blindly running rm -rf on project dependencies during active rebases, merges, or compiler runs risks file locking corruption and uncommitted code loss. Here is how Git Safety Intelligence audits repository health before deleting a single byte.