Skip to content

Detached and interactive mode: -d, -i and -t

Select an icon to see what it is.

Step 3 of 6

The CLI attaches over a raw stream

The CLI sends POST /containers/{id}/attach with stdin, stdout and stderr selected, and the connection is upgraded to a raw bidirectional stream. With a TTY the stream carries plain bytes, with no frame headers. A terminal has only one output, so stdout and stderr arrive merged.

POST /v1.45/containers/d6e7f8091a2b3c4dd6e7f8091a2b3c4dd6e7f8091a2b3c4dd6e7f8091a2b3c4d/attach?stream=1&stdin=1&stdout=1&stderr=1

the connection is upgraded to a raw stream
Tty true: raw bytes, stdout and stderr merged
Tty false: frames with an 8-byte header, as in the exec lesson