0
0
Dockerdevops~10 mins

Opening a shell in container 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 open an interactive shell inside a running Docker container named 'myapp'.

Docker
docker exec -it myapp [1]
Drag options to blanks, or click blank then click option'
Arun
Bstop
Cstart
D/bin/bash
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'run' instead of a shell path.
Trying to start or stop the container instead of opening a shell.
2fill in blank
medium

Complete the command to open a shell in a container with ID 'abc123' using sh shell.

Docker
docker exec -it abc123 [1]
Drag options to blanks, or click blank then click option'
A/bin/bash
Bbash
C/bin/sh
Dsh
Attempts:
3 left
💡 Hint
Common Mistakes
Using just 'sh' without the full path.
Using bash when it might not be installed.
3fill in blank
hard

Fix the error in the command to open a shell in container 'webapp'.

Docker
docker exec -it [1] /bin/bash
Drag options to blanks, or click blank then click option'
Awebapp
B-webapp
Cwebapp/
Dweb app
Attempts:
3 left
💡 Hint
Common Mistakes
Adding dashes or slashes to the container name.
Using spaces in the container name.
4fill in blank
hard

Fill both blanks to open a shell in container 'db' and keep the session interactive.

Docker
docker [1] -it [2] /bin/bash
Drag options to blanks, or click blank then click option'
Aexec
Brun
Cdb
Dstart
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'run' which starts a new container instead of exec.
Using 'start' which does not open a shell.
5fill in blank
hard

Fill all three blanks to open an interactive shell in container 'app1' using sh shell.

Docker
docker [1] [2] app1 [3]
Drag options to blanks, or click blank then click option'
Aexec
B-it
C/bin/sh
Drun
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'run' instead of 'exec'.
Forgetting the '-it' flags.
Using shell name without full path.