github.com/stchris/docker@v1.4.2-0.20150106053530-1510a324dbd5/docs/man/docker-attach.1.md (about) 1 % DOCKER(1) Docker User Manuals 2 % Docker Community 3 % JUNE 2014 4 # NAME 5 docker-attach - Attach to a running container 6 7 # SYNOPSIS 8 **docker attach** 9 [**--no-stdin**[=*false*]] 10 [**--sig-proxy**[=*true*]] 11 CONTAINER 12 13 # DESCRIPTION 14 If you **docker run** a container in detached mode (**-d**), you can reattach to 15 the detached container with **docker attach** using the container's ID or name. 16 17 You can detach from the container again (and leave it running) with `CTRL-p 18 CTRL-q` (for a quiet exit), or `CTRL-c` which will send a SIGKILL to the 19 container, or `CTRL-\` to get a stacktrace of the Docker client when it quits. 20 When you detach from a container the exit code will be returned to 21 the client. 22 23 It is forbidden to redirect the standard input of a docker attach command while 24 attaching to a tty-enabled container (i.e.: launched with -t`). 25 26 # OPTIONS 27 **--no-stdin**=*true*|*false* 28 Do not attach STDIN. The default is *false*. 29 30 **--sig-proxy**=*true*|*false* 31 Proxy all received signals to the process (non-TTY mode only). SIGCHLD, SIGKILL, and SIGSTOP are not proxied. The default is *true*. 32 33 # EXAMPLES 34 35 ## Attaching to a container 36 37 In this example the top command is run inside a container, from an image called 38 fedora, in detached mode. The ID from the container is passed into the **docker 39 attach** command: 40 41 # ID=$(sudo docker run -d fedora /usr/bin/top -b) 42 # sudo docker attach $ID 43 top - 02:05:52 up 3:05, 0 users, load average: 0.01, 0.02, 0.05 44 Tasks: 1 total, 1 running, 0 sleeping, 0 stopped, 0 zombie 45 Cpu(s): 0.1%us, 0.2%sy, 0.0%ni, 99.7%id, 0.0%wa, 0.0%hi, 0.0%si, 0.0%st 46 Mem: 373572k total, 355560k used, 18012k free, 27872k buffers 47 Swap: 786428k total, 0k used, 786428k free, 221740k cached 48 49 PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND 50 1 root 20 0 17200 1116 912 R 0 0.3 0:00.03 top 51 52 top - 02:05:55 up 3:05, 0 users, load average: 0.01, 0.02, 0.05 53 Tasks: 1 total, 1 running, 0 sleeping, 0 stopped, 0 zombie 54 Cpu(s): 0.0%us, 0.2%sy, 0.0%ni, 99.8%id, 0.0%wa, 0.0%hi, 0.0%si, 0.0%st 55 Mem: 373572k total, 355244k used, 18328k free, 27872k buffers 56 Swap: 786428k total, 0k used, 786428k free, 221776k cached 57 58 PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND 59 1 root 20 0 17208 1144 932 R 0 0.3 0:00.03 top 60 61 # HISTORY 62 April 2014, Originally compiled by William Henry (whenry at redhat dot com) 63 based on docker.com source material and internal work. 64 June 2014, updated by Sven Dowideit <SvenDowideit@home.org.au>