nerdexam
Docker

DCA · Question #42

A docker service 'web' is running with a scale factor of 1 (replicas = 1). Bob intends to use the command 'docker service update --replicas=3 web'. Alice intends to use the command 'docker service…

The correct answer is D. Both Bob's and Alice's commands result in exactly the same outcome, which is 3 instances of the. Both docker service update --replicas and docker service scale commands achieve the same outcome of changing the number of running instances for a Docker Swarm service.

Submitted by satoshi_tk· Apr 18, 2026Container Orchestration

Question

A docker service 'web' is running with a scale factor of 1 (replicas = 1). Bob intends to use the command 'docker service update --replicas=3 web'. Alice intends to use the command 'docker service scale web=3'. How do the outcomes oft these two commands differ?

Options

  • ABob's command results in an error. Alice's command updates the number of replicas of the 'web'
  • BBob's command only updates the service definition, but no new replicas are started. Alice's
  • CBob's command updates the number of replicas of the 'web' service to 3. Alice's command results
  • DBoth Bob's and Alice's commands result in exactly the same outcome, which is 3 instances of the

How the community answered

(55 responses)
  • A
    5% (3)
  • B
    2% (1)
  • C
    4% (2)
  • D
    89% (49)

Why each option

Both `docker service update --replicas` and `docker service scale` commands achieve the same outcome of changing the number of running instances for a Docker Swarm service.

ABob's command results in an error. Alice's command updates the number of replicas of the 'web'

Bob's command is a valid way to update service replicas and will not result in an error.

BBob's command only updates the service definition, but no new replicas are started. Alice's

Both commands update the service definition and trigger the Docker Swarm orchestrator to start new replicas, they do not just update the definition without action.

CBob's command updates the number of replicas of the 'web' service to 3. Alice's command results

Both commands have the same effect of scaling the service to 3 replicas, not different outcomes.

DBoth Bob's and Alice's commands result in exactly the same outcome, which is 3 instances of theCorrect

Both `docker service update --replicas=3 web` and `docker service scale web=3` result in exactly the same outcome: the 'web' service is scaled to have 3 running instances (replicas). The `docker service scale` command is a convenient shorthand that performs the same underlying service update operation as `docker service update --replicas`.

Concept tested: Docker Swarm service scaling commands

Source: https://docs.docker.com/engine/reference/commandline/service_scale/

Topics

#Docker Swarm#Service Scaling#Service Management#CLI

Community Discussion

No community discussion yet for this question.

Full DCA Practice