Which command can be used to list all running containers?

Prepare for the Docker Foundations Test. Review essential Docker concepts with multiple choice questions, each with hints and explanations. Ace your exam!

The command used to list all running containers is "docker ps." This command is specific to Docker and returns a list of currently active containers, including details such as their container IDs, names, status, and more. It provides a straightforward way to view the containers that are actively running on your Docker host.

The command "docker ps -a" includes all containers, not just the running ones, as it lists both running and stopped containers. While "docker container list" might seem plausible, it’s not the conventional command and would not work without the proper aliases or aliases set in your environment. On the other hand, "docker list containers" is not a valid command in Docker, as it does not follow the appropriate syntax that Docker expects.

By understanding how "docker ps" is structured and its purpose, it becomes clear why it is the correct choice for listing only the containers that are actively running at any given time.

Subscribe

Get the latest from Examzify

You can unsubscribe at any time. Read our privacy policy