Building your own (Domino) containers? Don’t forget to prune Docker
If you regularly build or pull images on a Docker host, disk usage can creep up quickly.
Most people know that Docker (and Podman) keeps old images around unless you prune them. What’s less obvious is the build cache. When you build images, like the Domino container, Docker stores intermediate layers, so future builds can be faster.
Even if you build with --no-cache (as the Domino build script does), Docker still writes layers to the build cache. They’re just not reused. Over time, that cache can grow significantly.
In my case, it explained why my root disk was filling up: 25+ GB of build cache.
Housekeeping your Docker host
To see what Docker is using: docker system df
After building the Domino image twice, I saw:
TYPE TOTAL ACTIVE SIZE RECLAIMABLE
Images 39 35 23.44GB 5.132GB (21%)
Containers 37 37 817.8MB 0B (0%)
Local Volumes 119 11 1.412GB 14MB (0%)
Build Cache 12 0 4.909GB 723kbA few things to note:
- Images: reclaimable space is what you’d expect.
- Build cache: can be large, and not always reclaimable at first glance.
- For details, use:
docker system df -v
Cleaning up
Basic cleanup options:
- Remove unused (dangling) images:
docker image prune
- Remove all unused images (not tied to a container):
docker image prune -a
The quick, all-in-one option: docker system prune
This removes:
- stopped containers
- unused networks
- dangling images
- unused build cache
A few gotchas
- Tags vs. images:
If your Domino container useshclcom/domino:latest, then a tag likehclcom/domino:14.5.1IF1may be removed by pruning. The underlying image stays, but the tag goes. - “Non-reclaimable” build cache:
Cache linked to images still in use won’t be removed by default. - Force removal of all build cache:
If you don’t care about reuse (e.g., with Domino builds), you can wipe everything:docker buildx prune -a
Conclusion
Docker doesn’t clean up after itself. If you build images regularly, especially with large builds like Domino, you’ll want to actively prune both images and build cache.
For most setups, a periodic:
docker system prune
is enough, but if you’re tight on disk space, it’s worth going a bit deeper.
