portworx / lcfs

LCFS Graph driver for Docker
Apache License 2.0
300 stars 27 forks source link

Provide mapping between layer identifiers to docker images/containers #14

Open jjobi opened 7 years ago

jjobi commented 7 years ago

It would be good to provide a mapping from layer identifiers (the directories seen under /lcfs/lcfs) to actual image and container names/identifiers.

jjobi commented 7 years ago

It looks like /lcfs/image/lcfs/repositories.json has an entry for every image present. From that, /lcfs/image/lcfs/imagdb/content/sha256/ can be located, from which diff-ids can be located. /lcfs/image/lcfs/layerdb/sha256//cache-id gives the layer name for the image layer.

It looks like there is a directory under /lcfs/containers for each container created and there are couple of files called init-id and mount-id under directory /lcfs/image/lcfs/layerdb/mounts/, with names of the layers created for that container.