github.com/containers/podman/v5@v5.1.0-rc1/docs/source/markdown/podman-container-inspect.1.md.in (about) 1 % podman-container-inspect 1 2 3 ## NAME 4 podman\-container\-inspect - Display a container's configuration 5 6 ## SYNOPSIS 7 **podman container inspect** [*options*] *container* [*container* ...] 8 9 ## DESCRIPTION 10 11 This displays the low-level information on containers identified by name or ID. By default, this renders 12 all results in a JSON array. If a format is specified, the given template is executed for each result. 13 14 ## OPTIONS 15 16 #### **--format**, **-f**=*format* 17 18 Format the output using the given Go template. 19 The keys of the returned JSON can be used as the values for the --format flag (see examples below). 20 21 Valid placeholders for the Go template are listed below: 22 23 | **Placeholder** | **Description** | 24 | ------------------------ | -------------------------------------------------- | 25 | .AppArmorProfile | AppArmor profile (string) | 26 | .Args | Command-line arguments (array of strings) | 27 | .BoundingCaps | Bounding capability set (array of strings) | 28 | .Config ... | Structure with config info | 29 | .ConmonPidFile | Path to file containing conmon pid (string) | 30 | .Created ... | Container creation time (string, ISO3601) | 31 | .Dependencies | Dependencies (array of strings) | 32 | .Driver | Storage driver (string) | 33 | .EffectiveCaps | Effective capability set (array of strings) | 34 | .ExecIDs | Exec IDs (array of strings) | 35 | .GraphDriver ... | Further details of graph driver (struct) | 36 | .HostConfig ... | Host config details (struct) | 37 | .HostnamePath | Path to file containing hostname (string) | 38 | .HostsPath | Path to container /etc/hosts file (string) | 39 | .ID | Container ID (full 64-char hash) | 40 | .Image | Container image ID (64-char hash) | 41 | .ImageDigest | Container image digest (sha256:+64-char hash) | 42 | .ImageName | Container image name (string) | 43 | .IsInfra | Is this an infra container? (string: true/false) | 44 | .IsService | Is this a service container? (string: true/false) | 45 | .KubeExitCodePropagation | Kube exit-code propagation (string) | 46 | .LockNumber | Number of the container's Libpod lock | 47 | .MountLabel | SELinux label of mount (string) | 48 | .Mounts | Mounts (array of strings) | 49 | .Name | Container name (string) | 50 | .Namespace | Container namespace (string) | 51 | .NetworkSettings ... | Network settings (struct) | 52 | .OCIConfigPath | Path to OCI config file (string) | 53 | .OCIRuntime | OCI runtime name (string) | 54 | .Path | Path to container command (string) | 55 | .PidFile | Path to file containing container PID (string) | 56 | .Pod | Parent pod (string) | 57 | .ProcessLabel | SELinux label of process (string) | 58 | .ResolvConfPath | Path to container's resolv.conf file (string) | 59 | .RestartCount | Number of times container has been restarted (int) | 60 | .Rootfs | Container rootfs (string) | 61 | .SizeRootFs | Size of rootfs, in bytes [1] | 62 | .SizeRw | Size of upper (R/W) container layer, in bytes [1] | 63 | .State ... | Container state info (struct) | 64 | .StaticDir | Path to container metadata dir (string) | 65 66 [1] This format specifier requires the **--size** option 67 68 @@option latest 69 70 #### **--size**, **-s** 71 72 In addition to normal output, display the total file size if the type is a container. 73 74 75 ## EXAMPLE 76 77 Inspect the specified container and print its information in json format. 78 ``` 79 $ podman container inspect foobar 80 [ 81 { 82 "Id": "99f66530fe9c7249f7cf29f78e8661669d5831cbe4ee80ea757d5e922dd6a8a6", 83 "Created": "2021-09-16T06:09:08.936623325-04:00", 84 "Path": "echo", 85 "Args": [ 86 "hi" 87 ], 88 "State": { 89 "OciVersion": "1.0.2-dev", 90 "Status": "exited", 91 "Running": false, 92 "Paused": false, 93 "Restarting": false, 94 "OOMKilled": false, 95 "Dead": false, 96 "Pid": 0, 97 "ExitCode": 0, 98 "Error": "", 99 "StartedAt": "2021-09-16T06:09:09.033564436-04:00", 100 "FinishedAt": "2021-09-16T06:09:09.036184314-04:00", 101 "Healthcheck": { 102 "Status": "", 103 "FailingStreak": 0, 104 "Log": null 105 } 106 }, 107 "Image": "14119a10abf4669e8cdbdff324a9f9605d99697215a0d21c360fe8dfa8471bab", 108 "ImageName": "docker.io/library/alpine:latest", 109 "Rootfs": "", 110 "Pod": "", 111 "ResolvConfPath": "/run/user/3267/containers/overlay-containers/99f66530fe9c7249f7cf29f78e8661669d5831cbe4ee80ea757d5e922dd6a8a6/userdata/resolv.conf", 112 "HostnamePath": "/run/user/3267/containers/overlay-containers/99f66530fe9c7249f7cf29f78e8661669d5831cbe4ee80ea757d5e922dd6a8a6/userdata/hostname", 113 "HostsPath": "/run/user/3267/containers/overlay-containers/99f66530fe9c7249f7cf29f78e8661669d5831cbe4ee80ea757d5e922dd6a8a6/userdata/hosts", 114 "StaticDir": "/home/dwalsh/.local/share/containers/storage/overlay-containers/99f66530fe9c7249f7cf29f78e8661669d5831cbe4ee80ea757d5e922dd6a8a6/userdata", 115 "OCIConfigPath": "/home/dwalsh/.local/share/containers/storage/overlay-containers/99f66530fe9c7249f7cf29f78e8661669d5831cbe4ee80ea757d5e922dd6a8a6/userdata/config.json", 116 "OCIRuntime": "crun", 117 "ConmonPidFile": "/run/user/3267/containers/overlay-containers/99f66530fe9c7249f7cf29f78e8661669d5831cbe4ee80ea757d5e922dd6a8a6/userdata/conmon.pid", 118 "PidFile": "/run/user/3267/containers/overlay-containers/99f66530fe9c7249f7cf29f78e8661669d5831cbe4ee80ea757d5e922dd6a8a6/userdata/pidfile", 119 "Name": "foobar", 120 "RestartCount": 0, 121 "Driver": "overlay", 122 "MountLabel": "system_u:object_r:container_file_t:s0:c25,c695", 123 "ProcessLabel": "system_u:system_r:container_t:s0:c25,c695", 124 "AppArmorProfile": "", 125 "EffectiveCaps": [ 126 "CAP_CHOWN", 127 "CAP_DAC_OVERRIDE", 128 "CAP_FOWNER", 129 "CAP_FSETID", 130 "CAP_KILL", 131 "CAP_NET_BIND_SERVICE", 132 "CAP_SETFCAP", 133 "CAP_SETGID", 134 "CAP_SETPCAP", 135 "CAP_SETUID", 136 ], 137 "BoundingCaps": [ 138 "CAP_CHOWN", 139 "CAP_DAC_OVERRIDE", 140 "CAP_FOWNER", 141 "CAP_FSETID", 142 "CAP_KILL", 143 "CAP_NET_BIND_SERVICE", 144 "CAP_SETFCAP", 145 "CAP_SETGID", 146 "CAP_SETPCAP", 147 "CAP_SETUID", 148 ], 149 "ExecIDs": [], 150 "GraphDriver": { 151 "Name": "overlay", 152 "Data": { 153 "LowerDir": "/home/dwalsh/.local/share/containers/storage/overlay/e2eb06d8af8218cfec8210147357a68b7e13f7c485b991c288c2d01dc228bb68/diff", 154 "UpperDir": "/home/dwalsh/.local/share/containers/storage/overlay/8f3d70434a3db17410ec4710caf4f251f3e4ed0a96a08124e4b3d4af0a0ea300/diff", 155 "WorkDir": "/home/dwalsh/.local/share/containers/storage/overlay/8f3d70434a3db17410ec4710caf4f251f3e4ed0a96a08124e4b3d4af0a0ea300/work" 156 } 157 }, 158 "Mounts": [], 159 "Dependencies": [], 160 "NetworkSettings": { 161 "EndpointID": "", 162 "Gateway": "", 163 "IPAddress": "", 164 "IPPrefixLen": 0, 165 "IPv6Gateway": "", 166 "GlobalIPv6Address": "", 167 "GlobalIPv6PrefixLen": 0, 168 "MacAddress": "", 169 "Bridge": "", 170 "SandboxID": "", 171 "HairpinMode": false, 172 "LinkLocalIPv6Address": "", 173 "LinkLocalIPv6PrefixLen": 0, 174 "Ports": {}, 175 "SandboxKey": "" 176 }, 177 "Namespace": "", 178 "IsInfra": false, 179 "Config": { 180 "Hostname": "99f66530fe9c", 181 "Domainname": "", 182 "User": "", 183 "AttachStdin": false, 184 "AttachStdout": false, 185 "AttachStderr": false, 186 "Tty": false, 187 "OpenStdin": false, 188 "StdinOnce": false, 189 "Env": [ 190 "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin", 191 "TERM=xterm", 192 "container=podman", 193 "HOME=/root", 194 "HOSTNAME=99f66530fe9c" 195 ], 196 "Cmd": [ 197 "echo", 198 "hi" 199 ], 200 "Image": "docker.io/library/alpine:latest", 201 "Volumes": null, 202 "WorkingDir": "/", 203 "Entrypoint": "", 204 "OnBuild": null, 205 "Labels": null, 206 "Annotations": { 207 "io.container.manager": "libpod", 208 "io.kubernetes.cri-o.Created": "2021-09-16T06:09:08.936623325-04:00", 209 "org.opencontainers.image.stopSignal": "15" 210 }, 211 "StopSignal": 15, 212 "CreateCommand": [ 213 "podman", 214 "run", 215 "--name", 216 "foobar", 217 "alpine", 218 "echo", 219 "hi" 220 ], 221 "Timezone": "local", 222 "Umask": "0022", 223 "Timeout": 0, 224 "StopTimeout": 10 225 }, 226 "HostConfig": { 227 "Binds": [], 228 "CgroupManager": "systemd", 229 "CgroupMode": "private", 230 "ContainerIDFile": "", 231 "LogConfig": { 232 "Type": "journald", 233 "Config": null, 234 "Path": "", 235 "Tag": "", 236 "Size": "0B" 237 }, 238 "NetworkMode": "slirp4netns", 239 "PortBindings": {}, 240 "RestartPolicy": { 241 "Name": "", 242 "MaximumRetryCount": 0 243 }, 244 "AutoRemove": false, 245 "VolumeDriver": "", 246 "VolumesFrom": null, 247 "CapAdd": [], 248 "CapDrop": [], 249 "Dns": [], 250 "DnsOptions": [], 251 "DnsSearch": [], 252 "ExtraHosts": [], 253 "GroupAdd": [], 254 "IpcMode": "shareable", 255 "Cgroup": "", 256 "Cgroups": "default", 257 "Links": null, 258 "OomScoreAdj": 0, 259 "PidMode": "private", 260 "Privileged": false, 261 "PublishAllPorts": false, 262 "ReadonlyRootfs": false, 263 "SecurityOpt": [], 264 "Tmpfs": {}, 265 "UTSMode": "private", 266 "UsernsMode": "", 267 "ShmSize": 65536000, 268 "Runtime": "oci", 269 "ConsoleSize": [ 270 0, 271 0 272 ], 273 "Isolation": "", 274 "CpuShares": 0, 275 "Memory": 0, 276 "NanoCpus": 0, 277 "CgroupParent": "user.slice", 278 "BlkioWeight": 0, 279 "BlkioWeightDevice": null, 280 "BlkioDeviceReadBps": null, 281 "BlkioDeviceWriteBps": null, 282 "BlkioDeviceReadIOps": null, 283 "BlkioDeviceWriteIOps": null, 284 "CpuPeriod": 0, 285 "CpuQuota": 0, 286 "CpuRealtimePeriod": 0, 287 "CpuRealtimeRuntime": 0, 288 "CpusetCpus": "", 289 "CpusetMems": "", 290 "Devices": [], 291 "DiskQuota": 0, 292 "KernelMemory": 0, 293 "MemoryReservation": 0, 294 "MemorySwap": 0, 295 "MemorySwappiness": 0, 296 "OomKillDisable": false, 297 "PidsLimit": 2048, 298 "Ulimits": [], 299 "CpuCount": 0, 300 "CpuPercent": 0, 301 "IOMaximumIOps": 0, 302 "IOMaximumBandwidth": 0, 303 "CgroupConf": null 304 } 305 } 306 ] 307 ``` 308 309 Inspect the specified container for the Image Name it is based on. 310 ``` 311 $ podman container inspect nervous_fermi --format "{{.ImageName}}" 312 registry.access.redhat.com/ubi8:latest 313 ``` 314 315 Inspect the specified container for the GraphDriver Name it is running with. 316 ``` 317 $ podman container inspect foobar --format "{{.GraphDriver.Name}}" 318 overlay 319 ``` 320 321 Inspect the latest container created for its EffectiveCaps field. (This option is not available with the remote Podman client, including Mac and Windows (excluding WSL2) machines) 322 ``` 323 $ podman container inspect --latest --format {{.EffectiveCaps}} 324 [CAP_CHOWN CAP_DAC_OVERRIDE CAP_FOWNER CAP_FSETID CAP_KILL CAP_NET_BIND_SERVICE CAP_SETFCAP CAP_SETGID CAP_SETPCAP CAP_SETUID] 325 ``` 326 327 ## SEE ALSO 328 **[podman(1)](podman.1.md)**, **[podman-container(1)](podman-container.1.md)**, **[podman-inspect(1)](podman-inspect.1.md)** 329 330 ## HISTORY 331 Sep 2021, Originally compiled by Dan Walsh <dwalsh@redhat.com>