Use docker container ls to list all running containers.
Use the flag -a to show all containers (not just running). i.e. docker container ls -a
Use the flag -q to show containers and their numeric IDs. i.e. docker container ls -q
Visit the documentation to learn all available options for this command.