github.com/hanks177/podman/v4@v4.1.3-0.20220613032544-16d90015bc83/docs/source/markdown/podman-inspect.1.md (about)

     1  % podman-inspect(1)
     2  
     3  ## NAME
     4  podman\-inspect - Display a container, image, volume, network, or pod's configuration
     5  
     6  ## SYNOPSIS
     7  **podman inspect** [*options*] *name* [...]
     8  
     9  ## DESCRIPTION
    10  
    11  This displays the low-level information on containers and images identified by name or ID. By default, this will render
    12  all results in a JSON array. If the inspect type is all, the order of inspection is: containers, images, volumes, network, pods.
    13   So, if a container has the same name as an image, then the container JSON will be returned, and so on.
    14   If a format is specified, the given template will be executed for each result.
    15  
    16  For more inspection options, see also
    17  [podman-container-inspect(1)](podman-container-inspect.1.md),
    18  [podman-image-inspect(1)](podman-image-inspect.1.md),
    19  [podman-network-inspect(1)](podman-network-inspect.1.md),
    20  [podman-pod-inspect(1)](podman-pod-inspect.1.md), and
    21  [podman-volume-inspect(1)](podman-volume-inspect.1.md).
    22  
    23  ## OPTIONS
    24  
    25  #### **--format**, **-f**=*format*
    26  
    27  Format the output using the given Go template.
    28  The keys of the returned JSON can be used as the values for the --format flag (see examples below).
    29  
    30  #### **--latest**, **-l**
    31  
    32  Instead of providing the container name or ID, use the last created container. If you use methods other than Podman
    33  to run containers such as CRI-O, the last started container could be from either of those methods.
    34  
    35  This option can be used to inspect the latest pod created when used with --type pod. (This option is not available with the remote Podman client, including Mac and Windows (excluding WSL2) machines, or when invoked as *podman image inspect*.)
    36  
    37  #### **--size**, **-s**
    38  
    39  In addition to normal output, display the total file size if the type is a container.
    40  
    41  #### **--type**, **-t**=*type*
    42  
    43  Return JSON for the specified type.  Type can be 'container', 'image', 'volume', 'network', 'pod', or 'all' (default: all)
    44  (Only meaningful when invoked as *podman inspect*)
    45  
    46  ## EXAMPLE
    47  
    48  ```
    49  # podman inspect fedora
    50  [
    51      {
    52          "Id": "f0858ad3febdf45bb2e5501cb459affffacef081f79eaa436085c3b6d9bd46ca",
    53          "Digest": "sha256:d4f7df6b691d61af6cee7328f82f1d8afdef63bc38f58516858ae3045083924a",
    54          "RepoTags": [
    55              "docker.io/library/fedora:latest"
    56          ],
    57          "RepoDigests": [
    58              "docker.io/library/fedora@sha256:8fa60b88e2a7eac8460b9c0104b877f1aa0cea7fbc03c701b7e545dacccfb433",
    59              "docker.io/library/fedora@sha256:d4f7df6b691d61af6cee7328f82f1d8afdef63bc38f58516858ae3045083924a"
    60          ],
    61          "Parent": "",
    62          "Comment": "",
    63          "Created": "2019-10-29T03:23:37.695123423Z",
    64          "Config": {
    65              "Env": [
    66                  "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin",
    67                  "DISTTAG=f31-updates-candidatecontainer",
    68                  "FGC=f31-updates-candidate",
    69                  "FBR=f31-updates-candidate"
    70              ],
    71              "Cmd": [
    72                  "/bin/bash"
    73              ],
    74              "Labels": {
    75                  "maintainer": "Clement Verna \u003ccverna@fedoraproject.org\u003e"
    76              }
    77          },
    78          "Version": "18.06.1-ce",
    79          "Author": "",
    80          "Architecture": "amd64",
    81          "Os": "linux",
    82          "Size": 201096840,
    83          "VirtualSize": 201096840,
    84          "GraphDriver": {
    85              "Name": "overlay",
    86              "Data": {
    87                  "UpperDir": "/home/user/.local/share/containers/storage/overlay/2ae3cee18c8ef9e0d448649747dab81c4f1ca2714a8c4550eff49574cab262c9/diff",
    88                  "WorkDir": "/home/user/.local/share/containers/storage/overlay/2ae3cee18c8ef9e0d448649747dab81c4f1ca2714a8c4550eff49574cab262c9/work"
    89              }
    90          },
    91          "RootFS": {
    92              "Type": "layers",
    93              "Layers": [
    94                  "sha256:2ae3cee18c8ef9e0d448649747dab81c4f1ca2714a8c4550eff49574cab262c9"
    95              ]
    96          },
    97          "Labels": {
    98              "maintainer": "Clement Verna \u003ccverna@fedoraproject.org\u003e"
    99          },
   100          "Annotations": {},
   101          "ManifestType": "application/vnd.docker.distribution.manifest.v2+json",
   102          "User": "",
   103          "History": [
   104              {
   105                  "created": "2019-01-16T21:21:55.569693599Z",
   106                  "created_by": "/bin/sh -c #(nop)  LABEL maintainer=Clement Verna \u003ccverna@fedoraproject.org\u003e",
   107                  "empty_layer": true
   108              },
   109              {
   110                  "created": "2019-09-27T21:21:07.784469821Z",
   111                  "created_by": "/bin/sh -c #(nop)  ENV DISTTAG=f31-updates-candidatecontainer FGC=f31-updates-candidate FBR=f31-updates-candidate",
   112                  "empty_layer": true
   113              },
   114              {
   115                  "created": "2019-10-29T03:23:37.355187998Z",
   116                  "created_by": "/bin/sh -c #(nop) ADD file:298f828afc880ccde9205fc4418435d5e696ad165e283f0530d0b1a74326d6dc in / "
   117              },
   118              {
   119                  "created": "2019-10-29T03:23:37.695123423Z",
   120                  "created_by": "/bin/sh -c #(nop)  CMD [\"/bin/bash\"]",
   121                  "empty_layer": true
   122              }
   123          ],
   124          "NamesHistory": []
   125      }
   126  ]
   127  ```
   128  
   129  ```
   130  # podman inspect a04 --format "{{.ImageName}}"
   131  fedora
   132  ```
   133  
   134  ```
   135  # podman inspect a04 --format "{{.GraphDriver.Name}}"
   136  overlay
   137  ```
   138  
   139  ```
   140  # podman image inspect --format "size: {{.Size}}" alpine
   141  size:   4405240
   142  ```
   143  
   144  ```
   145  podman container inspect --latest --format {{.EffectiveCaps}}
   146  [CAP_CHOWN CAP_DAC_OVERRIDE CAP_FSETID CAP_FOWNER CAP_MKNOD CAP_NET_RAW CAP_SETGID CAP_SETUID CAP_SETFCAP CAP_SETPCAP CAP_NET_BIND_SERVICE CAP_SYS_CHROOT CAP_KILL CAP_AUDIT_WRITE]
   147  ```
   148  
   149  ```
   150  # podman inspect myPod --type pod --format "{{.Name}}"
   151  myPod
   152  ```
   153  ```
   154  # podman inspect myVolume --type volume --format "{{.Name}}"
   155  myVolume
   156  ```
   157  
   158  ```
   159  # podman inspect nyNetwork --type network --format "{{.name}}"
   160  myNetwork
   161  ```
   162  
   163  ## SEE ALSO
   164  **[podman(1)](podman.1.md)**, **[podman-container-inspect(1)](podman-container-inspect.1.md)**, **[podman-image-inspect(1)](podman-image-inspect.1.md)**, **[podman-network-inspect(1)](podman-network-inspect.1.md)**, **[podman-pod-inspect(1)](podman-pod-inspect.1.md)**, **[podman-volume-inspect(1)](podman-volume-inspect.1.md)**
   165  
   166  ## HISTORY
   167  July 2017, Originally compiled by Dan Walsh <dwalsh@redhat.com>