André Amorim

Crafting Web Experiences

//

Filter Docker containers and list with specific information

The default running container listing command:

docker container ls

List all containers either running and stopped:

docker container ls -a

Choose specific information for the table that will be listed. I only wanted to list container names and their statuses:

docker container ls -a --format "table {{.Names}}t{{.Status}}"

And finally, filter them by container names. I’m filtering the containers which contain “_wp” word:

docker container ls -a --format "table {{.Names}}t{{.Status}}" --filter "name=_wp"

Reference: https://docs.docker.com/engine/reference/commandline/container_ls/


Published date:

Modified date: