Suppose I have a volume and I know its name or id.
I want to determine the list of containers (their names or ids) that use the volume.
What commands can I use to retrieve this information?
I thought it can be stored in the output of docker volume inspect <id>
command but it gives me nothing useful other than the mount point ("/var/lib/docker/volumes/<id>"
).
docker ps -a
) and then look at the relevant part ofdocker inspect
. – Facturedocker ps...
command, with...docker volume ls -q | xargs -I_ docker ps -a --filter volume=_
– Binette