0
0
Dockerdevops~10 mins

Restarting 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 restart a Docker container named 'webapp'.

Docker
docker container [1] webapp
Drag options to blanks, or click blank then click option'
Arestart
Bstart
Cstop
Dremove
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'stop' only stops the container without starting it again.
Using 'start' only starts a stopped container but does not restart it if running.
2fill in blank
medium

Complete the command to restart all running Docker containers.

Docker
docker ps -q | xargs docker [1]
Drag options to blanks, or click blank then click option'
Arm
Bstart
Crestart
Dstop
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'stop' will only stop containers without restarting.
Using 'rm' will remove containers instead of restarting.
3fill in blank
hard

Fix the error in the command to restart a container with ID 'abc123'.

Docker
docker container [1] abc123
Drag options to blanks, or click blank then click option'
Aremove
Bstart
Cstop
Drestart
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'start' does not restart a running container.
Using 'stop' only stops the container without starting it again.
4fill in blank
hard

Fill both blanks to restart all containers that are currently stopped.

Docker
docker ps -a -f status=[1] -q | xargs docker [2]
Drag options to blanks, or click blank then click option'
Aexited
Brestart
Crunning
Dstart
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'restart' on stopped containers is valid but here we want to start only.
Filtering by 'running' will select running containers, not stopped ones.
5fill in blank
hard

Fill all three blanks to restart containers with names starting with 'db'.

Docker
docker ps -a --filter name=[1] -q | xargs docker [2] [3]
Drag options to blanks, or click blank then click option'
A"^db"
Brestart
C--time=5
Dstart
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'start' instead of 'restart' will not restart running containers.
Not using quotes around the regex filter can cause errors.