5.7. Inspecting containers from the host
Use the podman inspect command to inspect the metadata of an existing container in a JSON format. You can specify the containers by their container ID or name.
Prerequisites
-
The
container-toolsmeta-package is installed.
Procedure
Inspect the container defined by ID 64ad95327c74:
To get all metadata:
$ podman inspect 64ad95327c74 [ { "Id": "64ad95327c740ad9de468d551c50b6d906344027a0e645927256cd061049f681", "Created": "2025-05-05T18:15:56.743553292+02:00", "Path": "/usr/bin/bash", "Args": [ "/usr/bin/bash" ], "State": { "OciVersion": "1.2.0", "Status": "running", ...To get particular items from the JSON file, for example, the
StartedAttimestamp:$ podman inspect --format='{{.State.StartedAt}}' 64ad95327c74 2021-03-02 11:23:54.945071961 +0100 CETThe information is stored in a hierarchy. To see the container
StartedAttimestamp (StartedAtis underState), use the--formatoption and the container ID or name.Examples of other items you might want to inspect include:
-
.Pathto see the command run with the container -
.Argsarguments to the command -
.Config.ExposedPortsTCP or UDP ports exposed from the container -
.State.Pidto see the process id of the container .HostConfig.PortBindingsport mapping from container to hostFor more information, see the
podman-inspect(1)man page on your system.