0
0
Dockerdevops~10 mins

Scaling services with replicas in Docker - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete 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'
A0
B3
C1
D5
Attempts:
3 left
💡 Hint
Common Mistakes
Using zero replicas which stops the service.
Using a number too high without resources.
2fill in blank
medium

Complete 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'
A2
B1
C4
D5
Attempts:
3 left
💡 Hint
Common Mistakes
Forgetting to specify replicas, which defaults to 1.
Using an invalid number like zero or negative.
3fill in blank
hard

Fix 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'
A2
Bscale=2
Cdb 2
Ddb=2
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.
4fill in blank
hard

Fill 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'
Aworker
B6
Cweb
D3
Attempts:
3 left
💡 Hint
Common Mistakes
Mixing up service name and replica count.
Using a wrong image name.
5fill in blank
hard

Fill 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'
Aredis:6
B5
Ccache
Dredis:latest
Attempts:
3 left
💡 Hint
Common Mistakes
Using wrong image tags.
Putting service name in the wrong place.