20.2. 使用 Buildah 检查容器和镜像
使用 buildah inspect
命令显示有关容器或镜像的信息。
先决条件
-
container-tools
元数据包已安装。 - 镜像是使用 Containerfile 中的指令构建的。详情请参阅 使用 Buildah 从 Containerfile 构建镜像 一节。
流程
检查镜像:
要检查 myecho 镜像,请输入:
# buildah inspect localhost/myecho { "Type": "buildah 0.0.1", "FromImage": "localhost/myecho:latest", "FromImageID": "b28cd00741b38c92382ee806e1653eae0a56402bcd2c8d31bdcd36521bc267a4", "FromImageDigest": "sha256:0f5b06cbd51b464fabe93ce4fe852a9038cdd7c7b7661cd7efef8f9ae8a59585", "Config": ... "Entrypoint": [ "/bin/sh", "-c", "\"/usr/local/bin/myecho\"" ], ... }
要检查来自于
myecho
镜像的工作容器:创建一个基于
localhost/myecho
镜像的可工作的容器:# buildah from localhost/myecho
检查
myecho-working-container
容器:# buildah inspect ubi-working-container { "Type": "buildah 0.0.1", "FromImage": "registry.access.redhat.com/ubi8/ubi:latest", "FromImageID": "272209ff0ae5fe54c119b9c32a25887e13625c9035a1599feba654aa7638262d", "FromImageDigest": "sha256:77623387101abefbf83161c7d5a0378379d0424b2244009282acb39d42f1fe13", "Config": ... "Container": "ubi-working-container", "ContainerID": "01eab9588ae1523746bb706479063ba103f6281ebaeeccb5dc42b70e450d5ad0", "ProcessLabel": "system_u:system_r:container_t:s0:c162,c1000", "MountLabel": "system_u:object_r:container_file_t:s0:c162,c1000", ... }
其他资源
-
您系统上的
buildah-inspect
手册页