Bird
0
0

What will happen if you run docker service scale cache=0 on a service named 'cache' currently running 3 replicas?

medium📝 Command Output Q5 of 15
Docker - Swarm
What will happen if you run docker service scale cache=0 on a service named 'cache' currently running 3 replicas?
AThe command will fail with an error
BThe service will keep running 3 containers
CThe service will scale to 1 container
DAll containers for 'cache' service will stop
Step-by-Step Solution
Solution:
  1. Step 1: Understand scaling to zero replicas

    Scaling to zero means no containers should run for that service.
  2. Step 2: Predict the effect on running containers

    All 3 running containers will stop, leaving zero.
  3. Final Answer:

    All containers for 'cache' service will stop -> Option D
  4. Quick Check:

    Scaling to 0 stops all containers [OK]
Quick Trick: Scale to 0 stops all service containers [OK]
Common Mistakes:
  • Thinking scaling to 0 keeps containers running
  • Assuming minimum 1 container always runs
  • Expecting an error on scaling to 0

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Docker Quizzes