You have a Docker service with 10 replicas. To perform a rolling update that updates 3 containers at a time and waits 5 seconds between each batch, which command should you use?
hard📝 Workflow Q8 of 15
Docker - Swarm
You have a Docker service with 10 replicas. To perform a rolling update that updates 3 containers at a time and waits 5 seconds between each batch, which command should you use?
Adocker service update --image myapp:latest --update-parallelism 1 --update-delay 10s myservice
Bdocker service update --image myapp:latest --update-parallelism 5 --update-delay 3s myservice
Cdocker service update --image myapp:latest --update-parallelism 10 --update-delay 0s myservice
Ddocker service update --image myapp:latest --update-parallelism 3 --update-delay 5s myservice
Step-by-Step Solution
Solution:
Step 1: Identify update parallelism
Update 3 containers at a time means setting --update-parallelism to 3.
Step 2: Set update delay
Wait 5 seconds between batches means --update-delay 5s.
Step 3: Verify command syntax
Command A correctly uses both options with the right values.
Final Answer:
docker service update --image myapp:latest --update-parallelism 3 --update-delay 5s myservice -> Option D
Quick Check:
Parallelism 3 and delay 5s match requirements [OK]
Quick Trick:Use --update-parallelism and --update-delay to control batches [OK]
Common Mistakes:
Mixing up parallelism and delay values
Setting parallelism higher than total replicas
Forgetting to specify update delay
Master "Swarm" in Docker
9 interactive learning modes - each teaches the same concept differently