Actions
Feature #44055
closedcephadm: make 'ls' faster
% Done:
80%
Source:
Tags:
performance
Backport:
Description
For both podman and docker, 'ps' tells you the image name but not its hash.
With podman, you can do:
- podman image list -a --format=json - podman ps -a --format=json
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
- docker ps --format='{{.ID}},{{.Image}},{{.Names}}'
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).
Actions