단일 플랫폼 이미지 검사
이 단계에서는 docker image inspect 명령을 사용하여 단일 플랫폼 Docker 이미지를 검사하는 방법을 배우게 됩니다. 이 명령은 이미지의 구성, 레이어 및 메타데이터를 포함한 상세 정보를 제공합니다.
먼저, 간단한 단일 플랫폼 이미지를 가져와 보겠습니다. 이 예제에서는 hello-world 이미지를 사용합니다.
docker pull hello-world
이미지가 가져와지고 있음을 나타내는 출력을 볼 수 있습니다.
Using default tag: latest
latest: Pulling from library/hello-world
...
Status: Downloaded newer image for hello-world:latest
docker.io/library/hello-world:latest
이제 이미지가 있으므로 검사할 수 있습니다. 이미지 이름 뒤에 docker image inspect 명령을 사용합니다.
docker image inspect hello-world
이 명령은 hello-world 이미지에 대한 다양한 세부 정보를 포함하는 큰 JSON 객체를 출력합니다. 이미지 ID, 생성 날짜, 아키텍처, 운영 체제 및 구성을 볼 수 있습니다.
[
{
"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": {
...
}
}
]
출력은 단일 이미지를 검사하는 경우에도 JSON 배열입니다. 이는 명령이 여러 이미지 이름을 인수로 받을 수 있기 때문입니다.