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 zero replicas which stops the service.
Using a number too high without resources.
✗ Incorrect
The command
docker service scale webapp=3 sets the number of replicas for the webapp service to 3.2fill in blank
mediumComplete the command to create a service named api with 4 replicas using the image myapi:latest.
Docker
docker service create --name api --replicas [1] myapi:latest Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Forgetting to specify replicas, which defaults to 1.
Using an invalid number like zero or negative.
✗ Incorrect
The option
--replicas 4 tells Docker to start 4 copies of the api service.3fill in blank
hardFix the error in the command to scale the service db to 2 replicas.
Docker
docker service scale [1] Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Leaving a space instead of using '=' between service and number.
Adding extra words like 'scale=' which is not valid here.
✗ Incorrect
The correct syntax is
docker service scale db=2 where the service name and replica count are joined by an equal sign.4fill in blank
hardFill both blanks to create a service named worker with 6 replicas using the image worker:stable.
Docker
docker service create --name [1] --replicas [2] worker:stable
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Mixing up service name and replica count.
Using a wrong image name.
✗ Incorrect
The service name is
worker and the replicas count is 6.5fill in blank
hardFill all three blanks to update the service cache to 5 replicas and use the image redis:6.
Docker
docker service update --image [1] --replicas [2] [3]
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using wrong image tags.
Putting service name in the wrong place.
✗ Incorrect
The command updates the
cache service to use image redis:6 and scale to 5 replicas.