0
0
Dockerdevops~10 mins

Blue-green deployment with containers 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 list all running Docker containers.

Docker
docker [1]
Drag options to blanks, or click blank then click option'
Aps
Brun
Cimages
Dbuild
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'docker images' lists images, not containers.
Using 'docker run' starts a container, not lists them.
2fill in blank
medium

Complete the command to start a new container named 'green' from the image 'myapp:latest'.

Docker
docker run -d --name [1] myapp:latest
Drag options to blanks, or click blank then click option'
Ablue
Byellow
Cred
Dgreen
Attempts:
3 left
💡 Hint
Common Mistakes
Naming the container 'blue' which is usually the old version.
Using unrelated names like 'red' or 'yellow'.
3fill in blank
hard

Fix the error in the command to stop the 'blue' container.

Docker
docker [1] blue
Drag options to blanks, or click blank then click option'
Astop
Bstart
Crun
Dbuild
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'start' which runs a container.
Using 'run' which creates a new container.
4fill in blank
hard

Fill both blanks to create a Docker network named 'blue-green-net' and connect the 'green' container to it.

Docker
docker network [1] blue-green-net
docker network [2] blue-green-net green
Drag options to blanks, or click blank then click option'
Acreate
Bremove
Cconnect
Ddisconnect
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'remove' or 'disconnect' which delete or detach networks or containers.
Trying to connect before creating the network.
5fill in blank
hard

Fill all three blanks to update the load balancer to point to the 'green' container, stop the 'blue' container, and remove it.

Docker
docker service update --publish-add [1] my-loadbalancer
docker [2] blue
docker [3] blue
Drag options to blanks, or click blank then click option'
A80:80
Bstop
Crm
D8080:80
Attempts:
3 left
💡 Hint
Common Mistakes
Using wrong port mappings like 8080:80 if not intended.
Removing before stopping the container.