[Docker] 이미지 검사/세부정보 얻기

무거운엉덩이·2022년 8월 1일
0

Docker

목록 보기
5/6

Docker image 혹은 container에 대해서 세부정보 얻기.

내려받은 Docker 이미지의 세부 정보를 확인할 수 있다.
명령은 다음과 같다.

docker inspect [option] <container name or Image name, Image ID>

그러면 아래와 같이 JSON 형식의 이미지에 대한 정보가 포함된 긴 출력결과가 표시된다.

아래의 정보는 node image를 inspect 명령으로 출력한 것이다.

[
    {
        "Id": "sha256:2324bac2d387f7855114bb88544b7c61d12a18316d0daca3a0731a23406cf408",
        "RepoTags": [
            "node:latest"
        ],
        "RepoDigests": [
            "node@sha256:ebd1096a66c724af78abb11e6c81eb05b85fcbe8920af2c24d42b6df6aab2687"
        ],
        "Parent": "",
        "Comment": "",
        "Created": "2022-07-27T18:30:50.190993349Z",
        "Container": "bb3d2ff62489309167298fc61340ea61ed877c6ffa71abccd2ce7934e0690865",
        "ContainerConfig": {
            "Hostname": "bb3d2ff62489",
            "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",
                "NODE_VERSION=18.7.0",
                "YARN_VERSION=1.22.19"
            ],
            "Cmd": [
                "/bin/sh",
                "-c",
                "#(nop) ",
                "CMD [\"node\"]"
            ],
            "Image": "sha256:a0b9d596b21dba1b18e59f6c8e429dc8bf44054803b20c0efe1e76fe1e8423e9",
            "Volumes": null,
            "WorkingDir": "",
            "Entrypoint": [
                "docker-entrypoint.sh"
            ],
            "OnBuild": null,
            "Labels": {}
        },
        "DockerVersion": "20.10.12",
        "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",
                "NODE_VERSION=18.7.0",
                "YARN_VERSION=1.22.19"
            ],
            "Cmd": [
                "node"
            ],
            "Image": "sha256:a0b9d596b21dba1b18e59f6c8e429dc8bf44054803b20c0efe1e76fe1e8423e9",
            "Volumes": null,
            "WorkingDir": "",
            "Entrypoint": [
                "docker-entrypoint.sh"
            ],
            "OnBuild": null,
            "Labels": null
        },
        "Architecture": "amd64",
        "Os": "linux",
        "Size": 989908983,
        "VirtualSize": 989908983,
        "GraphDriver": {
            "Data": {
                "LowerDir": "/var/lib/docker/overlay2/d3b622f07c4d8ec68a94fcda0143343233df1334bd0a621e85afc71ce34e2bb7/diff:/var/lib/docker/overlay2/4ad4df792f3237ba064a96ee5cdbd1ee8d976c08844a8a034201294e7f24630a/diff:/var/lib/docker/overlay2/23167799b7e9cfcf62fc8451991271bae11635020ca2cf36686febfb27be819d/diff:/var/lib/docker/overlay2/b7d71f0802c91cc8dcf2f16932a3c6d8c7c63985352b5a54279cf6d5a114894d/diff:/var/lib/docker/overlay2/e70efa3f6850e0c26aba7143c89210254b82aa928a2ac1f049f8d65e0985e981/diff:/var/lib/docker/overlay2/744c5d1d7db8c81c9ee4be05d70a05693ff98f049e6b7df276015084e94e2ada/diff:/var/lib/docker/overlay2/9369aedbfe3eea265f5d209f22bafec9748f9f5995a90fcd59183dcc87ef3c44/diff:/var/lib/docker/overlay2/3469265c9ac3749bbd2a75c71408eecbc1310966e26295751e290947fe18b48d/diff",
                "MergedDir": "/var/lib/docker/overlay2/d4cb9ce0839db9928626810b1d199a2ce6f7efd1d507c413f1f59055fe16ea39/merged",
                "UpperDir": "/var/lib/docker/overlay2/d4cb9ce0839db9928626810b1d199a2ce6f7efd1d507c413f1f59055fe16ea39/diff",
                "WorkDir": "/var/lib/docker/overlay2/d4cb9ce0839db9928626810b1d199a2ce6f7efd1d507c413f1f59055fe16ea39/work"
            },
            "Name": "overlay2"
        },
        "RootFS": {
            "Type": "layers",
            "Layers": [
                "sha256:5bdeef4a08f393fcbfa9e33e9abd8912a34d8f83dbae73e97564ca77fb01999b",
                "sha256:36cd374265f4eb8b2e944c88934e0b1b75e02b244d62b8c9c0dd84239f0ee136",
                "sha256:9be7f4e74e718ca2b7a8fca364478cdc4c45bb50595412706a4d42eacf511842",
                "sha256:7372faf8e6039e95daa0c10e9fd183a6000bc77febda0961fa1ada875d8b1d27",
                "sha256:59b0c7a2fe4db4eaa524d583c45cafebf0978269b3893e4b3f991db301db5c3e",
                "sha256:4fb89d99b009200b5bafb40682d68048b5a6627b18c5ec31858f84edff590998",
                "sha256:8dcad27847384de110760a48c9b02960a7588ff5527bb5acf57b32ec280a4f62",
                "sha256:ba60e4cf264f45b046a9128d4f3b208ce42f5b0479227a1b34d9c26e85d0d526",
                "sha256:72d0f2aec5b992a226cd8de60cd24aa7c493b2b011dfc5b65bf5dc1fbf5f61a7"
            ]
        },
        "Metadata": {
            "LastTagTime": "0001-01-01T00:00:00Z"
        }
    }
]

inspect 명령은 항상 필요한 것은 아니지만,

이미지가 어떻게 구성되어 있는지 확인하는 것은 가끔은 흥미롭단다.

profile
즐겁게 몰두하자. ^-^!

0개의 댓글