Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

List volumes of Docker container

Tags:

docker

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?

like image 542
starikovs Avatar asked May 14 '15 08:05

starikovs


3 Answers

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.

like image 85
wsl Avatar answered Sep 30 '22 08:09

wsl


Use this:

docker inspect --format='{{.HostConfig.Binds}}' <container id>
like image 41
Yogesh_D Avatar answered Sep 30 '22 07:09

Yogesh_D


You should try:

docker inspect <container> | grep "Volumes"

Glad it helped!

like image 28
jbarrueta Avatar answered Sep 30 '22 06:09

jbarrueta