Which command would provide information about the running services in a Docker stack?

Prepare for the Docker Certified Associate test with our comprehensive quizzes that include key questions and detailed explanations. Ace your certification!

The command that provides information about the running services in a Docker stack is indeed "docker stack services." This command is specifically designed to list the services associated with a specified Docker stack, showing the status of each service, the mode it's running in, and number of replicas. It is particularly useful in a multi-service environment facilitated by Docker Swarm, as it allows users to monitor and manage the deployed services effectively.

In contrast, while "docker service list" can be used to obtain a list of services within the Docker environment, it does not specifically tie services to a stack, which may limit its contextual relevance for users seeking stack-specific information. The "docker services inspect" command is focused on retrieving detailed information about a single service rather than listing multiple services within a stack. Lastly, the "docker stack list" command provides a list of all stacks, but not information about the services within those stacks. Therefore, the best command for checking the services running in a specific Docker stack is "docker stack services."

Subscribe

Get the latest from Examzify

You can unsubscribe at any time. Read our privacy policy