Home
Cloud
Big Data
CI
Install
Samples
Java
Ubuntu
Maven
Archive
Docker
|
Image Filesystem
Inspect Image Filesystem
Inspect Image Filesystem
To inspect an image, use the command "image inspect":
$ docker image inspect hello-world:latest | jq '.'
[ { "Id": "sha256:bf756fb1ae65adf866bd8c456593cd24beb6a0a061dedf42b26a993176745f6b", "RepoTags": [ "hello-world:latest" ], "RepoDigests": [ "hello-world@sha256:49a1c8800c94df04e9658809b006fd8a686cab8028d33cfba2cc049724254202" ], "Parent": "", "Comment": "", "Created": "2020-01-03T01:21:37.263809283Z", "Container": "71237a2659e6419aee44fc0b51ffbd12859d1a50ba202e02c2586ed999def583", "ContainerConfig": { "Hostname": "71237a2659e6", "Domainname": "", "User": "", "AttachStdin": false, "AttachStdout": false, "AttachStderr": false, "Tty": false, "OpenStdin": false, "StdinOnce": false, "Env": [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" ], "Cmd": [ "/bin/sh", "-c", "#(nop) ", "CMD [\"/hello\"]" ], "ArgsEscaped": true, "Image": "sha256:eb850c6a1aedb3d5c62c3a484ff01b6b4aade130b950e3bf3e9c016f17f70c34", "Volumes": null, "WorkingDir": "", "Entrypoint": null, "OnBuild": null, "Labels": {} }, "DockerVersion": "18.06.1-ce", "Author": "", "Config": { "Hostname": "", "Domainname": "", "User": "", "AttachStdin": false, "AttachStdout": false, "AttachStderr": false, "Tty": false, "OpenStdin": false, "StdinOnce": false, "Env": [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" ], "Cmd": [ "/hello" ], "ArgsEscaped": true, "Image": "sha256:eb850c6a1aedb3d5c62c3a484ff01b6b4aade130b950e3bf3e9c016f17f70c34", "Volumes": null, "WorkingDir": "", "Entrypoint": null, "OnBuild": null, "Labels": null }, "Architecture": "amd64", "Os": "linux", "Size": 13336, "VirtualSize": 13336, "GraphDriver": { "Data": { "MergedDir": "/var/lib/docker/overlay2/0217d9fbfbd6fa9211ce017c01fa45e1c4acba6ed88be794089457f0f2679eb6/merged", "UpperDir": "/var/lib/docker/overlay2/0217d9fbfbd6fa9211ce017c01fa45e1c4acba6ed88be794089457f0f2679eb6/diff", "WorkDir": "/var/lib/docker/overlay2/0217d9fbfbd6fa9211ce017c01fa45e1c4acba6ed88be794089457f0f2679eb6/work" }, "Name": "overlay2" }, "RootFS": { "Type": "layers", "Layers": [ "sha256:9c27e219663c25e0f28493790cc0b88bc973ba3b1686355f221c38a36978ac63" ] }, "Metadata": { "LastTagTime": "0001-01-01T00:00:00Z" } } ]
You can look at the "GraphDriver.Data" element and use the data directories to list the contents of the image:
$ sudo ls -al /var/lib/docker/overlay2/0217d9fbfbd6fa9211ce017c01fa45e1c4acba6ed88be794089457f0f2679eb6/diff
-rwxrwxr-x 1 root root 13336 Jan 2 2020 hello
The "RootFS.Layers" element list the image layers.
© 2010-2022
mti
tek