podman-ps:tldr:84012
The command podman ps --filter "ancestor=${image}:${tag}"
is used to list the running containers that have been created from a specific Docker image.
Here's how it works:
-
podman ps
is the main command that lists all the running containers on the system. -
--filter
is an option that filters the list of containers based on specific criteria. -
"ancestor=${image}:${tag}"
is the filter expression that specifies which containers to include in the list.-
${image}
and${tag}
are variables that need to be replaced with the actual image name and tag you want to filter by. For example, you might have an image named "myapp" with the tag "v1", so the expression becomesancestor=myapp:v1
. -
The "ancestor" filter looks for containers that were created based on a specific image. It ensures that only containers derived from the specified image are shown in the list.
-
By using this command, you can easily find which containers on your system are running instances of a particular Docker image with a specific tag.