NAME 名称

podman-inspect - Display a container, image, volume, network, or pod’s configuration
podman-inspect - 显示容器、镜像、卷、网络或 Pod 的配置

SYNOPSIS 概要

podman inspect [options] name […]
podman inspect [选项] 名称 […]

DESCRIPTION 描述

This displays the low-level information on containers and images identified by name or ID. By default, this renders all results in a JSON array. If the inspect type is all, the order of inspection is: containers, images, volumes, network, pods. If a container has the same name as an image, then the container JSON is returned, and so on. If a format is specified, the given template is executed for each result.
这将显示由名称或 ID 标识的容器和镜像的低级信息。默认情况下,这将以 JSON 数组的形式呈现所有结果。如果检查类型为 all,则检查顺序为:容器、镜像、卷、网络、Pod。如果容器与镜像同名,则返回容器 JSON,依此类推。如果指定了格式,则为每个结果执行给定的模板。

For more inspection options, see also podman-container-inspect(1), podman-image-inspect(1), podman-network-inspect(1), podman-pod-inspect(1), and podman-volume-inspect(1).
有关更多检查选项,请参阅 podman-container-inspect(1)、podman-image-inspect(1)、podman-network-inspect(1)、podman-pod-inspect(1) 和 podman-volume-inspect(1)。

OPTIONS 选项

--format, -f=format

Format the output using the given Go template. The keys of the returned JSON can be used as the values for the --format flag (see examples below).
使用给定的 Go 模板格式化输出。返回的 JSON 的键可以用作 --format 标志的值(请参见下面的示例)。

--latest, -l

Instead of providing the container name or ID, use the last created container. Note: the last started container can be from other users of Podman on the host machine. (This option is not available with the remote Podman client, including Mac and Windows (excluding WSL2) machines)
不要提供容器名称或 ID,而是使用最后创建的容器。注意:最后启动的容器可能来自主机上其他 Podman 用户。(此选项在远程 Podman 客户端中不可用,包括 Mac 和 Windows(不包括 WSL2)主机)

--size, -s --size,-s ¶

In addition to normal output, display the total file size if the type is a container.
除了正常输出外,如果类型是容器,则显示总文件大小。

--type, -t=type

Return JSON for the specified type. Type can be ‘container’, ‘image’, ‘volume’, ‘network’, ‘pod’, or ‘all’ (default: all) (Only meaningful when invoked as podman inspect)
返回指定类型的 JSON。类型可以是 'container'、'image'、'volume'、'network'、'pod' 或 'all'(默认为 all)(仅在作为 podman inspect 调用时有意义)。

EXAMPLE 例子 ¶

Inspect the fedora image:
检查 Fedora 镜像:

# podman inspect fedora
[
    {
        "Id": "f0858ad3febdf45bb2e5501cb459affffacef081f79eaa436085c3b6d9bd46ca",
        "Digest": "sha256:d4f7df6b691d61af6cee7328f82f1d8afdef63bc38f58516858ae3045083924a",
        "RepoTags": [
            "docker.io/library/fedora:latest"
        ],
        "RepoDigests": [
            "docker.io/library/fedora@sha256:8fa60b88e2a7eac8460b9c0104b877f1aa0cea7fbc03c701b7e545dacccfb433",
            "docker.io/library/fedora@sha256:d4f7df6b691d61af6cee7328f82f1d8afdef63bc38f58516858ae3045083924a"
        ],
        "Parent": "",
        "Comment": "",
        "Created": "2019-10-29T03:23:37.695123423Z",
        "Config": {
            "Env": [
                "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin",
                "DISTTAG=f31-updates-candidatecontainer",
                "FGC=f31-updates-candidate",
                "FBR=f31-updates-candidate"
            ],
            "Cmd": [
                "/bin/bash"
            ],
            "Labels": {
                "maintainer": "Clement Verna \u003ccverna@fedoraproject.org\u003e"
            }
        },
        "Version": "18.06.1-ce",
        "Author": "",
        "Architecture": "amd64",
        "Os": "linux",
        "Size": 201096840,
        "VirtualSize": 201096840,
        "GraphDriver": {
            "Name": "overlay",
            "Data": {
                "UpperDir": "/home/user/.local/share/containers/storage/overlay/2ae3cee18c8ef9e0d448649747dab81c4f1ca2714a8c4550eff49574cab262c9/diff",
                "WorkDir": "/home/user/.local/share/containers/storage/overlay/2ae3cee18c8ef9e0d448649747dab81c4f1ca2714a8c4550eff49574cab262c9/work"
            }
        },
        "RootFS": {
            "Type": "layers",
            "Layers": [
                "sha256:2ae3cee18c8ef9e0d448649747dab81c4f1ca2714a8c4550eff49574cab262c9"
            ]
        },
        "Labels": {
            "maintainer": "Clement Verna \u003ccverna@fedoraproject.org\u003e"
        },
        "Annotations": {},
        "ManifestType": "application/vnd.docker.distribution.manifest.v2+json",
        "User": "",
        "History": [
            {
                "created": "2019-01-16T21:21:55.569693599Z",
                "created_by": "/bin/sh -c #(nop)  LABEL maintainer=Clement Verna \u003ccverna@fedoraproject.org\u003e",
                "empty_layer": true
            },
            {
                "created": "2019-09-27T21:21:07.784469821Z",
                "created_by": "/bin/sh -c #(nop)  ENV DISTTAG=f31-updates-candidatecontainer FGC=f31-updates-candidate FBR=f31-updates-candidate",
                "empty_layer": true
            },
            {
                "created": "2019-10-29T03:23:37.355187998Z",
                "created_by": "/bin/sh -c #(nop) ADD file:298f828afc880ccde9205fc4418435d5e696ad165e283f0530d0b1a74326d6dc in / "
            },
            {
                "created": "2019-10-29T03:23:37.695123423Z",
                "created_by": "/bin/sh -c #(nop)  CMD [\"/bin/bash\"]",
                "empty_layer": true
            }
        ],
        "NamesHistory": []
    }
]

Inspect the specified image with the ImageName format specifier:
使用 ImageName 格式说明符检查指定的镜像:

# podman inspect a04 --format "{{.ImageName}}"
fedora

Inspect the specified image for GraphDriver format specifier:
使用 GraphDriver 格式说明符检查指定的镜像:

# podman inspect a04 --format "{{.GraphDriver.Name}}"
overlay

Inspect the specified image for its Size format specifier:
检查指定图像的 Size 格式说明符:

# podman image inspect --format "size: {{.Size}}" alpine
size:   4405240

Inspect the latest container created for EffectiveCaps format specifier. (This option is not available with the remote Podman client, including Mac and Windows (excluding WSL2) machines):
检查最新创建的容器的 EffectiveCaps 格式说明符。(此选项不适用于远程 Podman 客户端,包括 Mac 和 Windows(不包括 WSL2)机器):

podman container inspect --latest --format {{.EffectiveCaps}}
[CAP_CHOWN CAP_DAC_OVERRIDE CAP_FSETID CAP_FOWNER CAP_SETGID CAP_SETUID CAP_SETFCAP CAP_SETPCAP CAP_NET_BIND_SERVICE CAP_KILL]

Inspect the specified pod for the Name format specifier:
检查指定的 Pod 的 Name 格式说明符:

# podman inspect myPod --type pod --format "{{.Name}}"
myPod

Inspect the specified volume for the Name format specifier:
检查指定的卷以查找 Name 格式说明符:

# podman inspect myVolume --type volume --format "{{.Name}}"
myVolume

Inspect the specified network for the Name format specifier:
检查指定的网络以查找 Name 格式说明符:

# podman inspect nyNetwork --type network --format "{{.name}}"
myNetwork

SEE ALSO 参见 ¶

podman(1), podman-container-inspect(1), podman-image-inspect(1), podman-network-inspect(1), podman-pod-inspect(1), podman-volume-inspect(1)

HISTORY 历史 ¶

July 2017, Originally compiled by Dan Walsh dwalsh@redhat.com
2017 年 7 月,最初由 Dan Walsh dwalsh@redhat.com 编写