How can I list all the volumes of a Docker container? I understand that it should be easy to get but I cannot find how.
Also, is it possible to get the volumes of deleted containers and remove them?
You can use docker ps, get container id and write:
$ docker inspect container_id
like here:
"Volumes": {
..
},
"VolumesRW": {
..
}
It would give you all volumes of container.
Use this:
docker inspect --format='{{.HostConfig.Binds}}' <container id>
You should try:
docker inspect <container> | grep "Volumes"
Glad it helped!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With