Home/Blog/How to Reclaim 30+ GB of Docker Virtual Disk Space on macOS
Performance & Storage 5 min read• Published on 2026-10-06

How to Reclaim 30+ GB of Docker Virtual Disk Space on macOS

Docker Desktop creates a sprawling virtual disk container that never shrinks automatically. Here is how to reclaim your gigabytes.

👩‍💻
Claire Chen
Hardware Architecture Researcher

Because macOS runs a Unix Darwin kernel rather than native Linux, Docker Desktop operates inside a lightweight virtual machine. That virtual machine stores its data in a single massive file: ~/Library/Containers/com.docker.docker/Data/vms/0/data/Docker.raw.

The Docker.raw Virtual Disk Trap

The core problem with this virtual disk format is that it expands dynamically as you pull images, build layers, and spin up databases, but it never shrinks automatically when you delete containers. Over six months of software engineering, Docker.raw commonly balloons to 64 GB or more.

Standard Docker System Prune

Begin by removing unused containers, networks, dangling build caches, and images:

# Remove stopped containers, dangling images, and build caches
docker system prune -a --volumes -f

Compacting the Virtual Disk

Running docker system prune frees space inside the virtual machine, but macOS will still see the outer Docker.raw container taking up 60+ GB. To force a compaction:

  1. Open Docker Desktop Settings.
  2. Navigate to Resources → Advanced.
  3. Click Trim Virtual Disk to reclaim unused storage back to APFS.
Automate this with MacPax Clean
Clean Xcode caches, Docker raw containers, and unneeded universal binaries in 1-click on Apple Silicon.
#Docker#DevOps#Storage#Containers