How to Bulk Delete Unused Docker Images, Containers, Volumes, Networks, and Cache
This article introduces how to bulk delete unused Docker images, containers, volumes, networks, build cache, and more.
docker system prune --volumes
WARNING! This will remove:
- all stopped containers
- all networks not used by at least one container
- all volumes not used by at least one container
- all dangling images
- all build cache
Are you sure you want to continue? [y/N]
docker system prune | Docker Documentation
docker ps -a -f status=exited
docker rm $(docker ps -a -f status=exited -q)
docker volume ls -f dangling=true
docker volume prune
docker volume prune | Docker Documentation
docker images -f dangling=true
docker images purge
docker image prune | Docker Documentation
docker network purge
docker network prune | Docker Documentation
That’s all from the Gemba on bulk deleting unused Docker images, containers, volumes, networks, build cache, and more to free up disk space.