The default running container listing command:
docker container ls
Code language: Bash (bash)
List all containers either running and stopped:
docker container ls -a
Code 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/
Leave a Reply