docker attach
CautionAttach to PID 1
docker attach <container>
Connects to the main process itself (exec spawns a new one) — detach with Ctrl+P,Q or you'll stop it.
Examples
docker attach --detach-keys 'ctrl-x' web01Attach with a custom detach key
Syntax
docker attach [--detach-keys seq] <container>
Before you run it
Ctrl+C reaches and may kill PID 1.
Related commands
- docker execExec inside container
- docker logsContainer logs
The same reference, with no signal at all
Every command on this site, held on your device. The app adds 632 more: 1,510 commands and 120 fix flows, searchable with no connection. Free to install, no ads (some content is a one-time purchase).
Get it free on the App Store