Docker How To Delete Volume
We are going to show you how to delete a Docker volume. We also cover deleting multiple or all volumes at once.
Remove a volume:
docker volume rm data-volume1
Remove two volumes:
docker volume rm data-volume1 data-volume2
list volumes:
docker volume ls
- dangling volume - a volume not connected to any containers
List all dangling volumes:
docker volume ls -f dangling=true
Delete all dangling volumes:
docker volume prune
Remove container and volumes connected to that container:
docker rm -v test-server1
List only volume IDs:
docker volume ls -q
Remove all volumes:
docker volume rm $( docker volume ls -q )