podman-container-inspect(1)
<h1>π podman-container-inspect(1) β the general commands manual, but make it a vibe π</h1>
okay so you opened up podman-container-inspect(1) and honestly? good choice bestie. this is the page that tells you how to peer directly into a container's soul and see all its lowkey innermost config. no cap, it's giving x-ray vision for containers π©»β¨
πΈ NAME πΈ
podman-container-inspect β display a container's configuration ππ
β¨ SYNOPSIS β¨
podman container inspect [options] container [container ...]
π DESCRIPTION π
okay so picture this: you wanna see the low-level information on some containers, right? you can point at them by name or by ID β either one works, she's flexible like that π«Ά
by default, this thing renders all your results in a JSON array. very demure, very structured, very "here's everything at once" π¦β¨
but if you specify a format? oh it's over for the JSON-only era π the given template gets executed for each result β one pass per container, because she's thorough and she does not skip a single one, periodt π
π OPTIONS π
π¦ --format, -f=format π¦
this is the glow-up button β¨ it formats the output using the given Go template β so instead of the whole raw JSON dump you get exactly the little slice of info you asked for. main character energy, tailored to you π
and here's the iconic part: the keys of the returned JSON can be used as the values for the --format flag. literally just take a key name you saw in the JSON and drop it in there. see examples below, iykyk π
valid placeholders for the Go template are listed below ππ
(...and that's where we're picking up next, bestie β the placeholder list is coming right up π§ββοΈ)
.AppArmorProfileβ the AppArmor profile, as a string π‘οΈ.Argsβ the command-line arguments, as an array of strings.BoundingCapsβ the bounding capability set, as an array of strings.Config ...β whole structure with the config info inside, iykyk.ConmonPidFileβ path to the file holding the conmon pid, a string.Created ...β when the container was created, as a string in ISO3601 format β°.Dependenciesβ the dependencies, as an array of strings.Driverβ the storage driver, as a string.EffectiveCapsβ the effective capability set, as an array of strings.ExecIDsβ the exec IDs, as an array of strings.GraphDriver ...β further details of the graph driver, as a struct.HostConfig ...β the host config details, as a struct.HostnamePathβ path to the file holding the hostname, a string.HostsPathβ path to the container's/etc/hostsfile, a string.IDβ the container ID, the full 64-char hash π.Imageβ the container image ID, a 64-char hash.ImageDigestβ the container image digest,sha256:plus a 64-char hash.ImageNameβ the container image name, a string.IsInfraβ is this an infra container? stringtrue/false.IsServiceβ is this a service container? stringtrue/false.KubeExitCodePropagationβ the kube exit-code propagation, a string.LockNumberβ the number of the container's Libpod lock.MountLabelβ the SELinux label of the mount, a string.Mountsβ the mounts, as an array of strings.Nameβ the container name, a string β¨.Namespaceβ the container namespace, a string.NetworkSettings ...β the network settings, as a struct.OCIConfigPathβ path to the OCI config file, a string.OCIRuntimeβ the OCI runtime name, a string.Pathβ path to the container command, a string.PidFileβ path to the file holding the container PID, a string.Podβ the parent pod, a string π«.ProcessLabelβ the SELinux label of the process, a string.ResolvConfPathβ path to the container'sresolv.conffile, a string.RestartCountβ how many times the container has been restarted, an int π.Rootfsβ the container rootfs, a string.SizeRootFsβ size of the rootfs, in bytes [1].SizeRwβ size of the upper (R/W) container layer, in bytes [1].State ...β container state info (it's astruct, so like, a whole little world inside there πΈ).StaticDirβ path to the container metadata dir (astring).UseImageHostnameβ whether to use/etc/hostnamefrom the image if it exists? (string:true/false)- (blank row β yes bestie, the original really does have an empty row here, we don't make the rules π)
.UseImageHostsβ whether to use/etc/hostsfrom the image? (string:true/false)- (another blank row, serving absolutely nothing but we respect it π)
[1] This format specifier requires the--sizeoption β no--size, no size info, that's the rule fr fr.
β¨ OPTIONS β¨
--latest,-lβ instead of typing out a container name or ID like a whole entire paragraph, just grab the last created container π«Ά. Quick note though: the last started container can be from other users of Podman on the same host machine, so like, heads up π. (This option is not available with the remote Podman client, including Mac and Windows β excluding WSL2 β machines. Soz.)--size,-sβ on top of the normal output, it also shows you the total file size β but only if the type is a container π.
β¨ EXAMPLES β¨
okay so first up, bestie: inspect the specified container and print its information in json format. Itβs giving full data-dump main character energy, and we respect it π
$ podman container inspect foobar
[
{
"Id": "99f66530fe9c7249f7cf29f78e8661669d5831cbe4ee80ea757d5e922dd6a8a6",
"Created": "2021-09-16T06:09:08.936623325-04:00",
"Path": "echo",
"Args": [
"hi"
],
"State": {
"OciVersion": "1.0.2-dev",
"Status": "exited",
"Running": false,
"Paused": false,
"Restarting": false,
"OOMKilled": false,
"Dead": false,
"Pid": 0,
"ExitCode": 0,
"Error": "",
"StartedAt": "2021-09-16T06:09:09.033564436-04:00",
"FinishedAt": "2021-09-16T06:09:09.036184314-04:00",
"Healthcheck": {
"Status": "",
"FailingStreak": 0,
"Log": null
}
},
"Image": "14119a10abf4669e8cdbdff324a9f9605d99697215a0d21c360fe8dfa8471bab",
"ImageName": "docker.io/library/alpine:latest",
"Rootfs": "",
"Pod": "",
"ResolvConfPath": "/run/user/3267/containers/overlay-containers/99f66530fe9c7249f7cf29f78e8661669d5831cbe4ee80ea757d5e922dd6a8a6/userdata/resolv.conf",
"HostnamePath": "/run/user/3267/containers/overlay-containers/99f66530fe9c7249f7cf29f78e8661669d5831cbe4ee80ea757d5e922dd6a8a6/userdata/hostname",
"HostsPath": "/run/user/3267/containers/overlay-containers/99f66530fe9c7249f7cf29f78e8661669d5831cbe4ee80ea757d5e922dd6a8a6/userdata/hosts",
"StaticDir": "/home/dwalsh/.local/share/containers/storage/overlay-containers/99f66530fe9c7249f7cf29f78e8661669d5831cbe4ee80ea757d5e922dd6a8a6/userdata",
"OCIConfigPath": "/home/dwalsh/.local/share/containers/storage/overlay-containers/99f66530fe9c7249f7cf29f78e8661669d5831cbe4ee80ea757d5e922dd6a8a6/userdata/config.json",
"OCIRuntime": "crun",
"ConmonPidFile": "/run/user/3267/containers/overlay-containers/99f66530fe9c7249f7cf29f78e8661669d5831cbe4ee80ea757d5e922dd6a8a6/userdata/conmon.pid",
"PidFile": "/run/user/3267/containers/overlay-containers/99f66530fe9c7249f7cf29f78e8661669d5831cbe4ee80ea757d5e922dd6a8a6/userdata/pidfile",
"Name": "foobar",
"RestartCount": 0,
"Driver": "overlay",
"MountLabel": "system_u:object_r:container_file_t:s0:c25,c695",
"ProcessLabel": "system_u:system_r:container_t:s0:c25,c695",
"AppArmorProfile": "",
"EffectiveCaps": [
"CAP_CHOWN",
"CAP_DAC_OVERRIDE",
"CAP_FOWNER",
"CAP_FSETID",
"CAP_KILL",
"CAP_NET_BIND_SERVICE",
"CAP_SETFCAP",
"CAP_SETGID",
"CAP_SETPCAP",
"CAP_SETUID",
],
"BoundingCaps": [
"CAP_CHOWN",
"CAP_DAC_OVERRIDE",
"CAP_FOWNER",
"CAP_FSETID",
"CAP_KILL",
"CAP_NET_BIND_SERVICE",
"CAP_SETFCAP",
"CAP_SETGID",
"CAP_SETPCAP",
"CAP_SETUID",
],
"ExecIDs": [],
"GraphDriver": {
"Name": "overlay",
"Data": {
"LowerDir": "/home/dwalsh/.local/share/containers/storage/overlay/e2eb06d8af8218cfec8210147357a68b7e13f7c485b991c288c2d01dc228bb68/diff",
"UpperDir": "/home/dwalsh/.local/share/containers/storage/overlay/8f3d70434a3db17410ec4710caf4f251f3e4ed0a96a08124e4b3d4af0a0ea300/diff",
"WorkDir": "/home/dwalsh/.local/share/containers/storage/overlay/8f3d70434a3db17410ec4710caf4f251f3e4ed0a96a08124e4b3d4af0a0ea300/work"
}
},
"Mounts": [],
"Dependencies": [],
"NetworkSettings": {
"EndpointID": "",
"Gateway": "",
"IPAddress": "",
"IPPrefixLen": 0,
"IPv6Gateway": "",
"GlobalIPv6Address": "",
"GlobalIPv6PrefixLen": 0,
"MacAddress": "",
"Bridge": "",
"SandboxID": "",
"HairpinMode": false,
"LinkLocalIPv6Address": "",
"LinkLocalIPv6PrefixLen": 0,
"Ports": {},
"SandboxKey": ""
},
"Namespace": "",
"IsInfra": false,
"Config": {
"Hostname": "99f66530fe9c",
"Domainname": "",
"User": "",
"AttachStdin": false,
"AttachStdout": false,
"AttachStderr": false,
"Tty": false,
"OpenStdin": false,
"StdinOnce": false,
"Env": [
"PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin",
"TERM=xterm",
"container=podman",
"HOME=/root",
"HOSTNAME=99f66530fe9c"
],
"Cmd": [
"echo",
"hi"
],
"Image": "docker.io/library/alpine:latest",
"Volumes": null,
"WorkingDir": "/",
"Entrypoint": "",
"OnBuild": null,
"Labels": null,
"Annotations": {
"io.container.manager": "libpod",
"io.kubernetes.cri-o.Created": "2021-09-16T06:09:08.936623325-04:00",
"org.opencontainers.image.stopSignal": "15"
},
"StopSignal": 15,
"CreateCommand": [
"podman",
"run",
"--name",
"foobar",
"alpine",
"echo",
"hi"
],
"Timezone": "local",
"Umask": "0022",
"Timeout": 0,
"StopTimeout": 10
},
"HostConfig": {
"Binds": [],
"CgroupManager": "systemd",
"CgroupMode": "private",
"ContainerIDFile": "",
"LogConfig": {
"Type": "journald",
"Config": null,
"Path": "",
"Tag": "",
"Size": "0B"
},
"NetworkMode": "pasta",
"PortBindings": {},
"RestartPolicy": {
"Name": "",
"MaximumRetryCount": 0
},
"AutoRemove": false,
"VolumeDriver": "",
"VolumesFrom": null,
"CapAdd": [],
"CapDrop": [],
"Dns": [],
"DnsOptions": [],
"DnsSearch": [],
"ExtraHosts": [],
"GroupAdd": [],
"IpcMode": "shareable",
"Cgroup": "",
"Cgroups": "default",
"Links": null,
"OomScoreAdj": 0,
"PidMode": "private",
"Privileged": false,
"PublishAllPorts": false,
"ReadonlyRootfs": false,
"SecurityOpt": [],
"Tmpfs": {},
"UTSMode": "private",
"UsernsMode": "",
"ShmSize": 65536000,
"Runtime": "oci",
"ConsoleSize": [
0,
0
],
"Isolation": "",
"CpuShares": 0,
"Memory": 0,
"NanoCpus": 0,
"CgroupParent": "user.slice",
"BlkioWeight": 0,
"BlkioWeightDevice": null,
"BlkioDeviceReadBps": null,
"BlkioDeviceWriteBps": null,
"BlkioDeviceReadIOps": null,
"BlkioDeviceWriteIOps": null,
"CpuPeriod": 0,
"CpuQuota": 0,
"CpuRealtimePeriod": 0,
"CpuRealtimeRuntime": 0,
"CpusetCpus": "",
"CpusetMems": "",
"Devices": [],
"DiskQuota": 0,
"KernelMemory": 0,
"MemoryReservation": 0,
"MemorySwap": 0,
"MemorySwappiness": null,
"OomKillDisable": false,
"PidsLimit": 2048,
"Ulimits": [],
"CpuCount": 0,
"CpuPercent": 0,
"IOMaximumIOps": 0,
"IOMaximumBandwidth": 0,
"CgroupConf": null
}
}
]
Next: inspect the specified container for the Image Name it is based on. Ask for exactly that field and let it slay πΈ
$ podman container inspect nervous_fermi --format "{{.ImageName}}"
registry.access.redhat.com/ubi8:latest
Then: inspect the specified container for the GraphDriver Name it is running with. One field, zero drama, iconic behavior π
$ podman container inspect foobar --format "{{.GraphDriver.Name}}"
overlay
And last example: 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) β yes bestie, that caveat stays in the notes π«Ά
$ podman container inspect --latest --format {{.EffectiveCaps}}
[CAP_CHOWN CAP_DAC_OVERRIDE CAP_FOWNER CAP_FSETID CAP_KILL CAP_NET_BIND_SERVICE CAP_SETFCAP CAP_SETGID CAP_SETPCAP CAP_SETUID]
π SEE ALSO π
Go read these next, fr fr:
π HISTORY π
Sep 2021, Originally compiled by Dan Walsh dwalsh@redhat.com β¨mailto:dwalsh@redhat.comβ© β iconic origin story, no cap ππ
okay thatβs the whole page bestie! footer love: itβs podman-container-inspect(1) from the General Commands Manual, with a Sep 2021 date stamp πβ¨
π¦ where this page comes from
- arch rolling: podman 6.1.4-1 Β· Apache-2.0
- centos-stream 10: podman 7:6.1.0-2.el10 Β· Apache-2.0 AND BSD-2-Clause AND BSD-3-Clause AND ISC AND MIT AND MPL-2.0
- nixpkgs unstable: podman 6.1.4
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms