Forrest logo
back to the docker tool

docker:tldr:0b1a6

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

This command is used with Docker, a platform used to automate the deployment and management of applications within containers.

docker ps is a command used to list all running containers on your Docker host.

The --filter option is used to filter the results based on specific conditions or criteria. In this case, the filter is applied to find containers based on the specified ancestor image and tag.

${image} and ${tag} are placeholders for the actual values you want to use. The ${image} should be replaced with the name or ID of the ancestor image you want to filter by, and ${tag} should be replaced with the specific tag associated with that image.

For example, if you have an image named "myapp" and a tag "latest", the command would be: docker ps --filter "ancestor=myapp:latest". This will only display the running containers whose ancestral image matches "myapp:latest".

By using the --filter option with the specified ancestor image and tag, you can get a filtered list of running containers that are derived from that specific image and tag combination.

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 docker tool