How do you update a running Docker service in Swarm mode?

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

To update a running Docker service in Swarm mode, the appropriate command is 'docker service update.' This command allows you to modify various parameters of the service, such as the image version, environment variables, resource limits, and more, while the service is actively running. It ensures that the changes are applied seamlessly across the service's tasks, handling the update process with minimal downtime.

This command supports a variety of options that can specify how the update should be conducted. For instance, you can control the rollback behavior if needed or define how many tasks are updated at once, which is particularly useful for managing availability during the transition.

The other options provided do not correspond to valid Docker commands for updating services in Swarm mode. For example, 'docker service upgrade' is not a recognized command, as the correct term for updating services is 'update.' Similarly, 'docker service change' and 'docker service refresh' are not part of the Docker CLI and thus cannot be used to perform service updates in any context.

Subscribe

Get the latest from Examzify

You can unsubscribe at any time. Read our privacy policy