Forrest logo
back to the podman tool

podman-ps:tldr:84012

podman-ps: Filter containers that share a given image as an ancestor.
$ podman ps --filter "ancestor=${image}:${tag}"
try on your machine

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 becomes ancestor=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.

This explanation was created by an AI. In most cases those are correct. But please always be careful and never run a command you are not sure if it is safe.
back to the podman tool