Practice - 5 Tasks
Answer the questions below
1fill in blank
easyComplete the command to scale the service named webapp to 3 replicas.
Docker
docker service scale webapp=[1] Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using a number less than 1, which stops the service.
Forgetting the equal sign.
✗ Incorrect
The command
docker service scale webapp=3 sets the number of replicas of the webapp service to 3.2fill in blank
mediumComplete the command to list all running services and their replicas.
Docker
docker service [1] Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'ps' which shows tasks, not services.
Using 'show' which is not a valid docker service command.
✗ Incorrect
The command
docker service ls lists all services with their current replicas and status.3fill in blank
hardFix the error in the command to scale the service api to 5 replicas.
Docker
docker service scale [1]=5
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Adding extra words to the service name.
Using plural or hyphenated names incorrectly.
✗ Incorrect
The service name must match exactly. Here, the service is named
api, so the correct command is docker service scale api=5.4fill in blank
hardFill both blanks to create a command that updates the frontend service to have 4 replicas.
Docker
docker service update --replicas [1] [2]
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using the wrong service name.
Putting the service name before the replicas number.
✗ Incorrect
The command
docker service update --replicas 4 frontend updates the frontend service to 4 replicas. The --force flag is optional here.5fill in blank
hardFill all three blanks to write a command that forces update on the backend service and scales it to 6 replicas.
Docker
docker service update [1] [2] [3]
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Mixing service names.
Forgetting the --force flag.
✗ Incorrect
The command
docker service update --force --replicas 6 backend forces an update on the backend service and scales it to 6 replicas.