Docker and Colima Disk Cleanup for macOS Developers
Last updated: 2026-04-13
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.
Prune order and running workloads
Run heavier prunes when you can afford image re-pulls. `docker system prune -a` removes unused images — active containers keep their layers. Named volumes are not removed by default; use `docker volume prune` only when you know no database or named volume still needs its data. Colima/Lima VMs may need a restart after aggressive cleanup if the daemon reports stale state.
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. Each block shows a short label and the matching command.
Prune unused containers and images
docker system prune -aPrune unused volumes
docker volume pruneClear Docker build cache
docker builder prune -aShow Docker disk usage
docker system df # check disk usageList Colima profiles
colima list # check Colima VMsFrequently asked questions
- Will Docker prune delete my database volume?
- Anonymous unused volumes can be removed by volume prune. Named volumes that are still attached to a container are kept. Always review what Docker reports before confirming destructive prunes, and back up important data first.
- Why does Docker Desktop still show a large disk image after cleanup?
- The qcow2/raw image file often does not shrink automatically. After pruning inside Docker you may need to reclaim space using Docker Desktop's disk reclaim feature or recreate the VM — CodeCleaner helps you see what is consuming space before you choose that path.
Or 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.