1podman-container-inspect(1) General Commands Manualpodman-container-inspect(1)
2
3
4

NAME

6       podman-container-inspect - Display a container's configuration
7
8

SYNOPSIS

10       podman container inspect [options] container [container ...]
11
12

DESCRIPTION

14       This  displays  the  low-level  information on containers identified by
15       name or ID. By default, this will render all results in a  JSON  array.
16       If  a format is specified, the given template will be executed for each
17       result.
18
19

OPTIONS

21   --format, -f=format
22       Format the output using the given Go template.  The  keys  of  the  re‐
23       turned  JSON can be used as the values for the --format flag (see exam‐
24       ples below).
25
26
27       Valid placeholders for the Go template are listed below:
28
29
30       ┌─────────────────────┬───────────────────────────────┐
31Placeholder          Description                   
32       ├─────────────────────┼───────────────────────────────┤
33       │.AppArmorProfile     │ AppArmor profile (string)     │
34       ├─────────────────────┼───────────────────────────────┤
35       │.Args                │ Command-line arguments (array │
36       │                     │ of strings)                   │
37       ├─────────────────────┼───────────────────────────────┤
38       │.BoundingCaps        │ Bounding  capability set (ar‐ │
39       │                     │ ray of strings)               │
40       ├─────────────────────┼───────────────────────────────┤
41       │.Config ...          │ Structure with config info    │
42       ├─────────────────────┼───────────────────────────────┤
43       │.ConmonPidFile       │ Path to file containing  con‐ │
44       │                     │ mon pid (string)              │
45       ├─────────────────────┼───────────────────────────────┤
46       │.Created             │ Container    creation    time │
47       │                     │ (string, ISO3601)             │
48       ├─────────────────────┼───────────────────────────────┤
49       │.Dependencies        │ Dependencies    (array     of │
50       │                     │ strings)                      │
51       ├─────────────────────┼───────────────────────────────┤
52       │.Driver              │ Storage driver (string)       │
53       ├─────────────────────┼───────────────────────────────┤
54       │.EffectiveCaps       │ Effective capability set (ar‐ │
55       │                     │ ray of strings)               │
56       ├─────────────────────┼───────────────────────────────┤
57       │.ExecIDs             │ Exec IDs (array of strings)   │
58       ├─────────────────────┼───────────────────────────────┤
59       │.GraphDriver ...     │ Further  details   of   graph │
60       │                     │ driver (struct)               │
61       ├─────────────────────┼───────────────────────────────┤
62       │.HostConfig ...      │ Host config details (struct)  │
63       ├─────────────────────┼───────────────────────────────┤
64       │.HostnamePath        │ Path to file containing host‐ │
65       │                     │ name (string)                 │
66       ├─────────────────────┼───────────────────────────────┤
67       │.HostsPath           │ Path to container  /etc/hosts │
68       │                     │ file (string)                 │
69       ├─────────────────────┼───────────────────────────────┤
70       │.ID                  │ Container  ID  (full  64-char │
71       │                     │ hash)                         │
72       ├─────────────────────┼───────────────────────────────┤
73       │.Image               │ Container image  ID  (64-char │
74       │                     │ hash)                         │
75       ├─────────────────────┼───────────────────────────────┤
76       │.ImageName           │ Container image name (string) │
77       ├─────────────────────┼───────────────────────────────┤
78       │.IsInfra             │ Is  this  an infra container? │
79       │                     │ (string: true/false)          │
80       ├─────────────────────┼───────────────────────────────┤
81       │.IsService           │ Is this a service  container? │
82       │                     │ (string: true/false)          │
83       ├─────────────────────┼───────────────────────────────┤
84       │.MountLabel          │ SELinux    label   of   mount │
85       │                     │ (string)                      │
86       ├─────────────────────┼───────────────────────────────┤
87       │.Mounts              │ Mounts (array of strings)     │
88       ├─────────────────────┼───────────────────────────────┤
89       │.Name                │ Container name (string)       │
90       ├─────────────────────┼───────────────────────────────┤
91       │.Namespace           │ Container namespace (string)  │
92       ├─────────────────────┼───────────────────────────────┤
93       │.NetworkSettings ... │ Network settings (struct)     │
94       ├─────────────────────┼───────────────────────────────┤
95       │.OCIConfigPath       │ Path  to  OCI   config   file │
96       │                     │ (string)                      │
97       ├─────────────────────┼───────────────────────────────┤
98       │.OCIRuntime          │ OCI runtime name (string)     │
99       ├─────────────────────┼───────────────────────────────┤
100       │.Path                │ Path   to  container  command │
101       │                     │ (string)                      │
102       ├─────────────────────┼───────────────────────────────┤
103       │.PidFile             │ Path to file containing  con‐ │
104       │                     │ tainer PID (string)           │
105       ├─────────────────────┼───────────────────────────────┤
106       │.Pod                 │ Parent pod (string)           │
107       ├─────────────────────┼───────────────────────────────┤
108       │.ProcessLabel        │ SELinux   label   of  process │
109       │                     │ (string)                      │
110       ├─────────────────────┼───────────────────────────────┤
111       │.ResolvConfPath      │ Path   to   container's   re‐ │
112       │                     │ solv.conf file (string)       │
113       ├─────────────────────┼───────────────────────────────┤
114       │.RestartCount        │ Number of times container has │
115       │                     │ been restarted (int)          │
116       ├─────────────────────┼───────────────────────────────┤
117       │.Rootfs              │ Container rootfs (string)     │
118       ├─────────────────────┼───────────────────────────────┤
119       │.SizeRootFs          │ Size of rootfs, in bytes [1]  │
120       ├─────────────────────┼───────────────────────────────┤
121       │.SizeRw              │ Size of upper (R/W) container │
122       │                     │ layer, in bytes [1]           │
123       ├─────────────────────┼───────────────────────────────┤
124       │.State ...           │ Container state info (struct) │
125       ├─────────────────────┼───────────────────────────────┤
126       │.StaticDir           │ Path  to  container  metadata │
127       │                     │ dir (string)                  │
128       └─────────────────────┴───────────────────────────────┘
129
130       [1] This format specifier requires the --size option
131
132
133   --latest, -l
134       Instead of providing the container name or ID,  use  the  last  created
135       container.  If you use methods other than Podman to run containers such
136       as CRI-O, the last started container could  be  from  either  of  those
137       methods.
138
139
140       (This  option is not available with the remote Podman client, including
141       Mac and Windows (excluding WSL2) machines.)
142
143
144   --size, -s
145       In addition to normal output, display the total file size if  the  type
146       is a container.
147
148

EXAMPLE

150              $ podman container inspect foobar
151              [
152                  {
153                      "Id": "99f66530fe9c7249f7cf29f78e8661669d5831cbe4ee80ea757d5e922dd6a8a6",
154                      "Created": "2021-09-16T06:09:08.936623325-04:00",
155                      "Path": "echo",
156                      "Args": [
157                          "hi"
158                      ],
159                      "State": {
160                          "OciVersion": "1.0.2-dev",
161                          "Status": "exited",
162                          "Running": false,
163                          "Paused": false,
164                          "Restarting": false,
165                          "OOMKilled": false,
166                          "Dead": false,
167                          "Pid": 0,
168                          "ExitCode": 0,
169                          "Error": "",
170                          "StartedAt": "2021-09-16T06:09:09.033564436-04:00",
171                          "FinishedAt": "2021-09-16T06:09:09.036184314-04:00",
172                          "Healthcheck": {
173                              "Status": "",
174                              "FailingStreak": 0,
175                              "Log": null
176                          }
177                      },
178                      "Image": "14119a10abf4669e8cdbdff324a9f9605d99697215a0d21c360fe8dfa8471bab",
179                      "ImageName": "docker.io/library/alpine:latest",
180                      "Rootfs": "",
181                      "Pod": "",
182                      "ResolvConfPath": "/run/user/3267/containers/overlay-containers/99f66530fe9c7249f7cf29f78e8661669d5831cbe4ee80ea757d5e922dd6a8a6/userdata/resolv.conf",
183                      "HostnamePath": "/run/user/3267/containers/overlay-containers/99f66530fe9c7249f7cf29f78e8661669d5831cbe4ee80ea757d5e922dd6a8a6/userdata/hostname",
184                      "HostsPath": "/run/user/3267/containers/overlay-containers/99f66530fe9c7249f7cf29f78e8661669d5831cbe4ee80ea757d5e922dd6a8a6/userdata/hosts",
185                      "StaticDir": "/home/dwalsh/.local/share/containers/storage/overlay-containers/99f66530fe9c7249f7cf29f78e8661669d5831cbe4ee80ea757d5e922dd6a8a6/userdata",
186                      "OCIConfigPath": "/home/dwalsh/.local/share/containers/storage/overlay-containers/99f66530fe9c7249f7cf29f78e8661669d5831cbe4ee80ea757d5e922dd6a8a6/userdata/config.json",
187                      "OCIRuntime": "crun",
188                      "ConmonPidFile": "/run/user/3267/containers/overlay-containers/99f66530fe9c7249f7cf29f78e8661669d5831cbe4ee80ea757d5e922dd6a8a6/userdata/conmon.pid",
189                      "PidFile": "/run/user/3267/containers/overlay-containers/99f66530fe9c7249f7cf29f78e8661669d5831cbe4ee80ea757d5e922dd6a8a6/userdata/pidfile",
190                      "Name": "foobar",
191                      "RestartCount": 0,
192                      "Driver": "overlay",
193                      "MountLabel": "system_u:object_r:container_file_t:s0:c25,c695",
194                      "ProcessLabel": "system_u:system_r:container_t:s0:c25,c695",
195                      "AppArmorProfile": "",
196                      "EffectiveCaps": [
197                          "CAP_CHOWN",
198                          "CAP_DAC_OVERRIDE",
199                          "CAP_FOWNER",
200                          "CAP_FSETID",
201                          "CAP_KILL",
202                          "CAP_NET_BIND_SERVICE",
203                          "CAP_SETFCAP",
204                          "CAP_SETGID",
205                          "CAP_SETPCAP",
206                          "CAP_SETUID",
207                          "CAP_SYS_CHROOT"
208                      ],
209                      "BoundingCaps": [
210                          "CAP_CHOWN",
211                          "CAP_DAC_OVERRIDE",
212                          "CAP_FOWNER",
213                          "CAP_FSETID",
214                          "CAP_KILL",
215                          "CAP_NET_BIND_SERVICE",
216                          "CAP_SETFCAP",
217                          "CAP_SETGID",
218                          "CAP_SETPCAP",
219                          "CAP_SETUID",
220                          "CAP_SYS_CHROOT"
221                      ],
222                      "ExecIDs": [],
223                      "GraphDriver": {
224                          "Name": "overlay",
225                          "Data": {
226                              "LowerDir": "/home/dwalsh/.local/share/containers/storage/overlay/e2eb06d8af8218cfec8210147357a68b7e13f7c485b991c288c2d01dc228bb68/diff",
227                              "UpperDir": "/home/dwalsh/.local/share/containers/storage/overlay/8f3d70434a3db17410ec4710caf4f251f3e4ed0a96a08124e4b3d4af0a0ea300/diff",
228                              "WorkDir": "/home/dwalsh/.local/share/containers/storage/overlay/8f3d70434a3db17410ec4710caf4f251f3e4ed0a96a08124e4b3d4af0a0ea300/work"
229                          }
230                      },
231                      "Mounts": [],
232                      "Dependencies": [],
233                      "NetworkSettings": {
234                          "EndpointID": "",
235                          "Gateway": "",
236                          "IPAddress": "",
237                          "IPPrefixLen": 0,
238                          "IPv6Gateway": "",
239                          "GlobalIPv6Address": "",
240                          "GlobalIPv6PrefixLen": 0,
241                          "MacAddress": "",
242                          "Bridge": "",
243                          "SandboxID": "",
244                          "HairpinMode": false,
245                          "LinkLocalIPv6Address": "",
246                          "LinkLocalIPv6PrefixLen": 0,
247                          "Ports": {},
248                          "SandboxKey": ""
249                      },
250                      "Namespace": "",
251                      "IsInfra": false,
252                      "Config": {
253                          "Hostname": "99f66530fe9c",
254                          "Domainname": "",
255                          "User": "",
256                          "AttachStdin": false,
257                          "AttachStdout": false,
258                          "AttachStderr": false,
259                          "Tty": false,
260                          "OpenStdin": false,
261                          "StdinOnce": false,
262                          "Env": [
263                              "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin",
264                              "TERM=xterm",
265                              "container=podman",
266                              "HOME=/root",
267                              "HOSTNAME=99f66530fe9c"
268                          ],
269                          "Cmd": [
270                              "echo",
271                              "hi"
272                          ],
273                          "Image": "docker.io/library/alpine:latest",
274                          "Volumes": null,
275                          "WorkingDir": "/",
276                          "Entrypoint": "",
277                          "OnBuild": null,
278                          "Labels": null,
279                          "Annotations": {
280                              "io.container.manager": "libpod",
281                              "io.kubernetes.cri-o.Created": "2021-09-16T06:09:08.936623325-04:00",
282                              "io.kubernetes.cri-o.TTY": "false",
283                              "io.podman.annotations.autoremove": "FALSE",
284                              "io.podman.annotations.init": "FALSE",
285                              "io.podman.annotations.privileged": "FALSE",
286                              "io.podman.annotations.publish-all": "FALSE",
287                              "org.opencontainers.image.stopSignal": "15"
288                          },
289                          "StopSignal": 15,
290                          "CreateCommand": [
291                              "podman",
292                              "run",
293                              "--name",
294                              "foobar",
295                              "alpine",
296                              "echo",
297                              "hi"
298                          ],
299                          "Timezone": "local",
300                          "Umask": "0022",
301                          "Timeout": 0,
302                          "StopTimeout": 10
303                      },
304                      "HostConfig": {
305                          "Binds": [],
306                          "CgroupManager": "systemd",
307                          "CgroupMode": "private",
308                          "ContainerIDFile": "",
309                          "LogConfig": {
310                              "Type": "journald",
311                              "Config": null,
312                              "Path": "",
313                              "Tag": "",
314                              "Size": "0B"
315                          },
316                          "NetworkMode": "slirp4netns",
317                          "PortBindings": {},
318                          "RestartPolicy": {
319                              "Name": "",
320                              "MaximumRetryCount": 0
321                          },
322                          "AutoRemove": false,
323                          "VolumeDriver": "",
324                          "VolumesFrom": null,
325                          "CapAdd": [],
326                          "CapDrop": [
327                              "CAP_AUDIT_WRITE",
328                              "CAP_MKNOD",
329                              "CAP_NET_RAW"
330                          ],
331                          "Dns": [],
332                          "DnsOptions": [],
333                          "DnsSearch": [],
334                          "ExtraHosts": [],
335                          "GroupAdd": [],
336                          "IpcMode": "shareable",
337                          "Cgroup": "",
338                          "Cgroups": "default",
339                          "Links": null,
340                          "OomScoreAdj": 0,
341                          "PidMode": "private",
342                          "Privileged": false,
343                          "PublishAllPorts": false,
344                          "ReadonlyRootfs": false,
345                          "SecurityOpt": [],
346                          "Tmpfs": {},
347                          "UTSMode": "private",
348                          "UsernsMode": "",
349                          "ShmSize": 65536000,
350                          "Runtime": "oci",
351                          "ConsoleSize": [
352                              0,
353                              0
354                          ],
355                          "Isolation": "",
356                          "CpuShares": 0,
357                          "Memory": 0,
358                          "NanoCpus": 0,
359                          "CgroupParent": "user.slice",
360                          "BlkioWeight": 0,
361                          "BlkioWeightDevice": null,
362                          "BlkioDeviceReadBps": null,
363                          "BlkioDeviceWriteBps": null,
364                          "BlkioDeviceReadIOps": null,
365                          "BlkioDeviceWriteIOps": null,
366                          "CpuPeriod": 0,
367                          "CpuQuota": 0,
368                          "CpuRealtimePeriod": 0,
369                          "CpuRealtimeRuntime": 0,
370                          "CpusetCpus": "",
371                          "CpusetMems": "",
372                          "Devices": [],
373                          "DiskQuota": 0,
374                          "KernelMemory": 0,
375                          "MemoryReservation": 0,
376                          "MemorySwap": 0,
377                          "MemorySwappiness": 0,
378                          "OomKillDisable": false,
379                          "PidsLimit": 2048,
380                          "Ulimits": [],
381                          "CpuCount": 0,
382                          "CpuPercent": 0,
383                          "IOMaximumIOps": 0,
384                          "IOMaximumBandwidth": 0,
385                          "CgroupConf": null
386                      }
387                  }
388              ]
389
390
391
392              $ podman container inspect nervous_fermi --format "{{.ImageName}}"
393              registry.access.redhat.com/ubi8:latest
394
395
396
397              $ podman container inspect foobar --format "{{.GraphDriver.Name}}"
398              overlay
399
400
401
402              $ podman container inspect --latest --format {{.EffectiveCaps}}
403              [CAP_CHOWN CAP_DAC_OVERRIDE CAP_FOWNER CAP_FSETID CAP_KILL CAP_NET_BIND_SERVICE CAP_SETFCAP CAP_SETGID CAP_SETPCAP CAP_SETUID CAP_SYS_CHROOT]
404
405
406

SEE ALSO

408       podman(1), podman-container(1), podman-inspect(1)
409
410

HISTORY

412       Sep   2021,   Originally   compiled   by  Dan  Walsh  dwalsh@redhat.com
413       ⟨mailto:dwalsh@redhat.com⟩
414
415
416
417                                                   podman-container-inspect(1)
Impressum