We can list both running and stopped containers.
Listing containers
Getting ready
Ensure that the Docker daemon is running on the host and can be connected through the Docker client. You will also need a few running and/or stopped containers.
How to do it...
To list the containers, either run the following command:
docker container ls [OPTIONS]
Or run the following legacy command:
docker ps [OPTIONS]