Practice - 5 Tasks
Answer the questions below
1fill in blank
easyComplete 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'
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.
✗ Incorrect
The
docker attach command connects your terminal to a running container's main process.2fill in blank
mediumComplete 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'
Attempts:
3 left
💡 Hint
Common Mistakes
Using '--no-stdin' which disables input instead of keeping it open.
Confusing '--detach-keys' with signal forwarding.
✗ Incorrect
The
--sig-proxy option forwards signals to the container, keeping STDIN open during attach.3fill in blank
hardFix 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'
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.
✗ Incorrect
The correct option to keep STDIN open and forward signals is
--sig-proxy.4fill in blank
hardFill 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'
Attempts:
3 left
💡 Hint
Common Mistakes
Using single dash options which are invalid.
Mixing option names without dashes.
✗ Incorrect
The correct syntax uses
--detach-keys ctrl-x to set detach keys and --sig-proxy to forward signals.5fill in blank
hardFill 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'
Attempts:
3 left
💡 Hint
Common Mistakes
Using '--no-stdin' which disables input.
Forgetting to set detach keys properly.
Omitting interactive mode option.
✗ Incorrect
Use
--sig-proxy to forward signals, --detach-keys to set keys, and --interactive to keep STDIN open.