Feature #44055
Updated by Sebastian Wagner about 4 years ago
For both podman and docker, 'ps' tells you the image name but not its hash.
With podman, you can do:
<pre>
- podman image list -a --format=json
- podman ps -a --format=json
</pre>
and cross-reference against the image history list to see if there are multiple images with the name name+tag. If so, inspect those containers.
With docker, you can do
<pre>
- docker ps --format='{{.ID}},{{.Image}},{{.Names}}'
</pre>
Unlike podman, the .Image field here is the name+tag (podman only shows this if it is the *most recent*, AFACIS; otherwise you have to look in the history list). Similarly, though, if we see multiple images with the same name+tag, then we can inspect just those containers.
The net of this would be two very fast (~100ms) commands instead of an inspect for every container (which nets out to ~3.5 seconds on my host with ~25 containers).
With podman, you can do:
<pre>
- podman image list -a --format=json
- podman ps -a --format=json
</pre>
and cross-reference against the image history list to see if there are multiple images with the name name+tag. If so, inspect those containers.
With docker, you can do
<pre>
- docker ps --format='{{.ID}},{{.Image}},{{.Names}}'
</pre>
Unlike podman, the .Image field here is the name+tag (podman only shows this if it is the *most recent*, AFACIS; otherwise you have to look in the history list). Similarly, though, if we see multiple images with the same name+tag, then we can inspect just those containers.
The net of this would be two very fast (~100ms) commands instead of an inspect for every container (which nets out to ~3.5 seconds on my host with ~25 containers).