Inspect a Container Image
Tasks
- Identify the base image of a container image
- List the layers of a container image
- Inspect the metadata of a container image
- Verify the integrity of a container image
Requirements
- Use the
docker
command-line tool to inspect the container image
- The container image to be inspected is
nginx:latest
- Perform all operations in the
/home/labex
directory
Example
$ docker image inspect nginx:latest
[
{
"Id": "sha256:f7b3d4b7d8c5d5f7f4c2c7d5c7f4c2c7d5c7f4c2c7d5c7f4c2c7d5c7f4c2c7d",
"RepoTags": [
"nginx:latest"
],
"RepoDigests": [
"nginx@sha256:4d8d5c7f4c2c7d5c7f4c2c7d5c7f4c2c7d5c7f4c2c7d5c7f4c2c7d5c7f4c2c7d"
],
"Parent": "",
"Comment": "",
"Created": "2023-04-05T12:34:56.789Z",
"Container": "4d8d5c7f4c2c7d5c7f4c2c7d5c7f4c2c7d5c7f4c2c7d5c7f4c2c7d5c7f4c2c7d",
"ContainerConfig": {
...
},
"DockerVersion": "20.10.14",
"Author": "",
"Config": {
...
},
"Architecture": "amd64",
"Os": "linux",
"Layers": [
"sha256:4d8d5c7f4c2c7d5c7f4c2c7d5c7f4c2c7d5c7f4c2c7d5c7f4c2c7d5c7f4c2c7d",
"sha256:4d8d5c7f4c2c7d5c7f4c2c7d5c7f4c2c7d5c7f4c2c7d5c7f4c2c7d5c7f4c2c7d",
"sha256:4d8d5c7f4c2c7d5c7f4c2c7d5c7f4c2c7d5c7f4c2c7d5c7f4c2c7d5c7f4c2c7d"
]
}
]