Remove only dangling images and build cache#
docker rmi $(docker images -f "dangling=true" -q)
Remove all images not associated with any container#
docker image prune -a
Comprehensive cleanup#
- Stopped Containers
- Unused Networks
- Dangling Images
- Dangling Build Cache
docker system prune -a
Reference#
https://www.baeldung.com/ops/docker-remove-dangling-unused-images