Docker CLI

docker attach

Connects to the main process streams, without creating a second process. Input and forwarded signals can affect the application. With an interactive TTY fixture and default detach keys, Ctrl+P then Ctrl+Q can detach; do not assume this works without the relevant terminal configuration. Prefer logs for reading recorded output. Requires the approved interactive bm-v04-attach fixture. Verify configured detach keys and terminal settings; typing exit may terminate the main shell.

Formal Syntax & Structure

docker syntaxdocker
docker attach [OPTIONS] CONTAINER

Parameters & Attributes

NameTypeDescription
CONTAINERstringRunning container name or ID.
--no-stdinflagDo not connect standard input.
--detach-keysstringOverride the detach sequence.
--sig-proxybooleanControl signal forwarding to the process.

Working Example

Example Snippetdocker
docker attach bm-v04-attach
Docker Reference