In this step, you will learn how to inspect a single-platform Docker image using the docker image inspect
command. This command provides detailed information about an image, including its configuration, layers, and metadata.
First, let's pull a simple single-platform image. We will use the hello-world
image for this example.
docker pull hello-world
You should see output indicating that the image is being pulled.
Using default tag: latest
latest: Pulling from library/hello-world
...
Status: Downloaded newer image for hello-world:latest
docker.io/library/hello-world:latest
Now that we have the image, we can inspect it. Use the docker image inspect
command followed by the image name.
docker image inspect hello-world
This command will output a large JSON object containing various details about the hello-world
image. You will see information like the image ID, creation date, architecture, operating system, and configuration.
[
{
"Id": "sha256:...",
"RepoTags": [
"hello-world:latest"
],
"RepoDigests": [
"hello-world@sha256:..."
],
"Parent": "",
"Comment": "",
"Created": "...",
"Container": "...",
"ContainerConfig": {
...
},
"DockerVersion": "...",
"Author": "",
"Config": {
...
},
"Architecture": "amd64",
"Os": "linux",
"Size": ...,
"VirtualSize": ...,
"GraphDriver": {
...
},
"RootFS": {
...
},
"Metadata": {
...
}
}
]
The output is a JSON array, even if you are inspecting a single image. This is because the command can accept multiple image names as arguments.