How to link docker images to their composing layers on the disk?

前端 未结 3 1023
没有蜡笔的小新
没有蜡笔的小新 2021-02-10 05:05

Since Docker v1.10, with the introduction of the content addressable storage, Docker has completely changed the way image data are handled on the disk. I understand that now lay

3条回答
  •  渐次进展
    2021-02-10 05:13

    If this is a vfs this can be done with this one-liner:

    ls -l /var/lib/docker/vfs/dir/$(cat $(grep $LAYER /var/lib/docker/image/vfs/layerdb/sha256/ -rl | sed s/diff/cache-id/g ))
    

    where $LAYER is the sha256 that you get out of docker inspect IMAGE_ID

提交回复
热议问题