Filter Docker containers and list with specific information

The default running container listing command:

docker container lsCode language: Bash (bash)

List all containers either running and stopped:

docker container ls -aCode language: Bash (bash)

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}}"Code language: Bash (bash)

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"Code language: Bash (bash)

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


Posted

in

,

by

Tags:

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.