docker buildx imagetools inspect
docker buildx imagetools inspect
docker buildx imagetools inspect는 레지스트리에 있는 이미지의 세부 정보를 보여주는 명령이에요. 매니페스트와 플랫폼 목록을 확인할 때 사용해요.
출처: 문서
본문
docker buildx imagetools inspect는 레지스트리의 이미지 세부 정보를 표시해요. 기본적으로 매니페스트와 그 안의 각 플랫폼 정보를 보여줘요.
지원하는 옵션은 다음과 같아요.
| 옵션 | 기본값 | 설명 |
|---|---|---|
--format |
{{.Manifest}} |
커스텀 템플릿으로 출력 형식을 지정해요 (table, json, pretty 등) |
--raw |
원본(비포맷) JSON 매니페스트를 보여줘요 |
Override the configured builder instance (--builder)
buildx --builder와 동일해요.
Format the output (--format)
주어진 Go 템플릿으로 출력을 포맷해요. 설정하지 않으면 기본값 {{.Manifest}}이에요. 사용 가능한 필드는 다음과 같아요.
.Name: 이미지의 참조.Manifest: 매니페스트 또는 매니페스트 목록.Image: 이미지 구성(config)
.Name
$ docker buildx imagetools inspect alpine --format "{{.Name}}"
Name: docker.io/library/alpine:latest
.Manifest
$ docker buildx imagetools inspect crazymax/loop --format "{{.Manifest}}"
Name: docker.io/crazymax/loop:latest
MediaType: application/vnd.docker.distribution.manifest.v2+json
Digest: sha256:08602e7340970e92bde5e0a2e887c1fde4d9ae753d1e05efb4c8ef3b609f97f1
JSON output
필드를 JSON 형식으로 렌더링하고 싶다면 json 템플릿 함수도 사용할 수 있어요.
$ docker buildx imagetools inspect crazymax/buildkit:attest --format "{{json .Manifest}}"
{
"schemaVersion": 2,
"mediaType": "application/vnd.oci.image.index.v1+json",
"digest": "sha256:7007b387ccd52bd42a050f2e8020e56e64622c9269bf7bbe257b326fe99daf19",
"size": 855,
"manifests": []
}
Multi-platform
.Image, .SLSA, .SBOM 필드에 대해 멀티플랫폼 이미지가 지원돼요. 특정 플랫폼을 고르려면 index Go 템플릿 함수로 지정할 수 있어요.
$ docker buildx imagetools inspect --format '{{json (index .Image "linux/s390x")}}' moby/buildkit:master
The following command provides SLSA JSON output:
$ docker buildx imagetools inspect crazymax/buildkit:attest --format "{{json .Provenance}}"
Show original JSON manifest (--raw)
--raw 옵션으로 원시 JSON 매니페스트를 출력해요.
$ docker buildx imagetools inspect --raw crazymax/loop
{
"schemaVersion": 2,
"mediaType": "application/vnd.docker.distribution.manifest.v2+json",
"config": {
"digest": "sha256:a98999183d2c7a8845f6d56496e51099ce6e4359ee7255504174b05430c4b78b",
"mediaType": "application/vnd.docker.container.image.v1+json",
"size": 2762
},
"layers": []
}