Docker and Colima Disk Cleanup for macOS Developers
Last updated: 2026-04-06
Docker Desktop and Colima store images, containers, volumes, and build cache in disk images that grow over time but rarely shrink on their own. Unused images from old projects, stopped containers, dangling volumes, and accumulated build cache layers can consume 10–30 GB. Colima additionally creates Lima VMs under ~/.colima and ~/.lima that can consume 5–20 GB each. These resources can be safely pruned using official Docker CLI commands.
Why Docker disk usage grows
Every Docker image you pull or build is stored locally. When you update an image, the old version remains unless explicitly removed. Stopped containers retain their filesystem layers. Named and anonymous volumes persist after containers are removed. Build cache layers accumulate from every docker build. Docker Desktop stores all of this inside a single disk image (Docker.raw or Docker.qcow2) that grows but does not automatically shrink.
Colima and Lima VMs
Colima is a popular Docker Desktop alternative for macOS. It creates Lima virtual machines under ~/.colima and ~/.lima. Each VM has its own disk image that can be 5–20 GB. If you have created multiple Colima instances or profiles, each has its own VM. CodeCleaner detects Colima installations and shows the disk footprint of each VM.
Docker prune commands
Docker provides built-in prune commands: `docker system prune` removes stopped containers, dangling images, and unused networks. Adding -a also removes unused images. `docker volume prune` removes unnamed volumes. `docker builder prune` clears build cache. CodeCleaner uses these official commands rather than deleting files directly, ensuring safe cleanup.
How CodeCleaner handles Docker cleanup
CodeCleaner integrates with the Docker CLI to show exactly how much space images, containers, volumes, and build cache consume individually. It can prune them safely using official docker prune commands — not by deleting files directly. For Colima users, it also detects and measures the Lima VM disk footprint so you can make informed decisions about reclaiming space.
Manual steps (Terminal)
You can do this manually with these commands, or use CodeCleaner to automate the process with a visual interface and safety checks.
docker system prune -adocker volume prunedocker builder prune -adocker system df # check disk usagecolima list # check Colima VMsOr use CodeCleaner
CodeCleaner automates all of this with a native macOS app. It auto-detects your installed tools, scans the relevant paths in parallel, shows per-item sizes, and lets you clean safely with one click. Free scan, no account required.