docker - how to determine which mount belongs to which image?

12/17/2018

We use device mapper storage driver. This is probably more of a docker than k8s question.

Is there is a way to determine for example where this mount is coming from

/opt/dsx/ibm-data-platform/docker/devicemapper/mnt/b1127f21d5fd96b2ac862624d80b928decc1d60b87ec64d98430f69f360d3cee/rootfs/usr/lib/jvm/java-1.6.0-openjdk-1.6.0.39.x86_64/jre/lib/rt.jar

You see devicemapper/mnt/b1127f21d5fd96b2ac862624d80b928decc1d60b87ec64d98430f69f360d3cee as part of the path..

We use a commercial product that has 67 different images bundled in. One particular above has a very old Java .. we'd like to know which image that docker mount is coming from.

Thanks!

-- Tagar
device-mapper
docker
docker-container
kubectl
kubernetes

1 Answer

12/18/2018

You can ask Docker for a list of containers that have that volume mounted:

docker container ls --filter=volume=<name of volume>

-- Rawkode
Source: StackOverflow