get container name docker code example
Example 1: how to get list of docker containers
1. docker container ls -a
2. docker ps -a
Example 2: docker ps only show names
docker ps --format '{{.Names}}'
Example 3: docker list containers
# List curently active containers
$ docker ps