0
0
Dockerdevops~10 mins

Attaching to running 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 attach your terminal to a running Docker container named myapp.

Docker
docker [1] myapp
Drag options to blanks, or click blank then click option'
Aattach
Brun
Cbuild
Dstop
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'run' instead of 'attach' which starts a new container instead of connecting.
Using 'stop' which stops the container instead of attaching.
2fill in blank
medium

Complete the command to attach to a running container with ID abc123 and keep STDIN open.

Docker
docker attach --[1] abc123
Drag options to blanks, or click blank then click option'
Ano-stdin
Binteractive
Csig-proxy
Ddetach-keys
Attempts:
3 left
💡 Hint
Common Mistakes
Using '--no-stdin' which disables input instead of keeping it open.
Confusing '--detach-keys' with signal forwarding.
3fill in blank
hard

Fix the error in the command to attach to a container named webapp but keep STDIN open.

Docker
docker attach --[1] webapp
Drag options to blanks, or click blank then click option'
Ano-stdin
Binteractive
Cdetach-keys
Dsig-proxy
Attempts:
3 left
💡 Hint
Common Mistakes
Using '--no-stdin' which disables input.
Using '--detach-keys' which sets keys to detach but doesn't keep STDIN open.
4fill in blank
hard

Fill both blanks to create a command that attaches to container db and sets custom detach keys to ctrl-x.

Docker
docker attach --[1] ctrl-x --[2] db
Drag options to blanks, or click blank then click option'
Adetach-keys
Bsig-proxy
C--detach-keys
D--sig-proxy
Attempts:
3 left
💡 Hint
Common Mistakes
Using single dash options which are invalid.
Mixing option names without dashes.
5fill in blank
hard

Fill all three blanks to attach to container cache, keep STDIN open, and set detach keys to ctrl-p,ctrl-q.

Docker
docker attach [1] [2] ctrl-p,ctrl-q [3] cache
Drag options to blanks, or click blank then click option'
A--sig-proxy
B--detach-keys
C--no-stdin
D--interactive
Attempts:
3 left
💡 Hint
Common Mistakes
Using '--no-stdin' which disables input.
Forgetting to set detach keys properly.
Omitting interactive mode option.