0
0
Dockerdevops~10 mins

Deploying services in Swarm 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 initialize a Docker Swarm on the current node.

Docker
docker swarm [1]
Drag options to blanks, or click blank then click option'
Acreate
Bstart
Claunch
Dinit
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'start' instead of 'init' which is not a valid swarm command.
Using 'create' or 'launch' which are not Docker swarm commands.
2fill in blank
medium

Complete the command to deploy a service named 'web' using the nginx image.

Docker
docker service [1] --name web nginx
Drag options to blanks, or click blank then click option'
Acreate
Bdeploy
Cstart
Drun
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'deploy' which is not a valid Docker service command.
Using 'run' which is for containers, not services.
3fill in blank
hard

Fix the error in the command to scale the 'web' service to 3 replicas.

Docker
docker service scale web=[1]
Drag options to blanks, or click blank then click option'
Areplica=3
B3
Cscale=3
Dreplicas=3
Attempts:
3 left
💡 Hint
Common Mistakes
Including 'replicas=' or 'scale=' which causes syntax errors.
Using singular 'replica=3' which is incorrect.
4fill in blank
hard

Fill both blanks to update the 'web' service image to 'nginx:alpine' and force the update.

Docker
docker service update --image [1] --force [2]
Drag options to blanks, or click blank then click option'
Anginx:alpine
Bweb
Cnginx
Dservice
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'nginx' without the tag which updates to the latest image, not alpine.
Using 'service' instead of the actual service name.
5fill in blank
hard

Fill all three blanks to create a replicated service named 'db' with 2 replicas using the 'mysql:5.7' image.

Docker
docker service create --name [1] --replicas [2] [3]
Drag options to blanks, or click blank then click option'
Adb
B2
Cmysql:5.7
Dmysql
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'mysql' without the version tag which may cause version mismatch.
Confusing the order of options or missing the service name.