Which command would you use to list services in a stack called 'web-store'?

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

To list services in a stack called 'web-store', the command docker stack services web-store is utilized because it is the appropriate syntax for interacting with Docker stacks. This command specifically targets the services that belong to a defined stack and returns information about those services, such as their ID, name, mode, and the number of replicas.

Understanding the context of Docker commands is critical. The docker stack command group is specifically designed for managing multi-container Docker applications, known as stacks, which are defined in a Compose file. The services subcommand indicates that the user is interested in listing the current services associated with the specified stack.

Other commands do not follow the correct syntax or purpose. For instance, the alternative options involve commands that do not exist or are not meant for the intended operation. This highlights the importance of familiarizing oneself with the Docker command structure and functions.

Subscribe

Get the latest from Examzify

You can unsubscribe at any time. Read our privacy policy