Bird
0
0

You want to update a running service frontend to use a new image version frontend:v2 without downtime. Which command achieves this?

hard📝 Workflow Q9 of 15
Docker - Swarm
You want to update a running service frontend to use a new image version frontend:v2 without downtime. Which command achieves this?
Adocker service scale frontend=0 && docker service create --name frontend frontend:v2
Bdocker service update --image frontend:v2 frontend
Cdocker service restart frontend --image frontend:v2
Ddocker container update --image frontend:v2 frontend
Step-by-Step Solution
Solution:
  1. Step 1: Identify update command

    'docker service update' updates service properties including image without downtime.
  2. Step 2: Eliminate incorrect options

    Restart command does not accept image flag; scaling down removes service; container update is invalid.
  3. Final Answer:

    docker service update --image frontend:v2 frontend -> Option B
  4. Quick Check:

    Use 'docker service update' to change image live [OK]
Quick Trick: Use 'docker service update --image' to upgrade services smoothly [OK]
Common Mistakes:
  • Trying to restart service with image flag
  • Scaling down and recreating causes downtime
  • Using container update which doesn't change service image

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Docker Quizzes