Use Search Filter With Docker

As part of my Docker coverage series and Yesterday’s post about Attach Data Volume To A Windows Container User Docker, In this In his article I’ll show you how to use the Docker Filter switch and search for containers.

The Filter switch allows us to create search queries and find containers with specific status like created, restarting, running, paused, exited and dead.

In the example below will Filter and return all the Containers with exited status.

docker ps --filter status=exited

To search for all running containers type:

docker ps --filter status=running

In the example below I can search for all containers that starts with the name Test:

docker ps --filter "name=test*"

To search for containers with a specific Image name type:

Docker ps -a --filter ancestor=windowsservercore