docker-attach.1 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. .\" Process this file with
  2. .\" nroff -man -Tascii docker-attach.1
  3. .\"
  4. .TH "DOCKER" "1" "APRIL 2014" "0.1" "Docker"
  5. .SH NAME
  6. docker-attach \- Attach to a running container
  7. .SH SYNOPSIS
  8. .B docker attach
  9. \fB--no-stdin\fR[=\fIfalse\fR]
  10. \fB--sig-proxy\fR[=\fItrue\fR]
  11. container
  12. .SH DESCRIPTION
  13. If you \fBdocker run\fR a container in detached mode (\fB-d\fR), you can reattach to the detached container with \fBdocker attach\fR using the container's ID or name.
  14. .sp
  15. You can detach from the container again (and leave it running) with CTRL-c (for a quiet exit) or CTRL-\ to get a stacktrace of the Docker client when it quits. When you detach from the container the exit code will be returned to the client.
  16. .SH "OPTIONS"
  17. .TP
  18. .B --no-stdin=\fItrue\fR|\fIfalse\fR:
  19. When set to true, do not attach to stdin. The default is \fIfalse\fR.
  20. .TP
  21. .B --sig-proxy=\fItrue\fR|\fIfalse\fR:
  22. When set to true, proxify all received signal to the process (even in non-tty mode). The default is \fItrue\fR.
  23. .sp
  24. .SH EXAMPLES
  25. .sp
  26. .PP
  27. .B Attaching to a container
  28. .TP
  29. In this example the top command is run inside a container, from an image called fedora, in detached mode. The ID from the container is passed into the \fBdocker attach\fR command:
  30. .sp
  31. .nf
  32. .RS
  33. # ID=$(sudo docker run -d fedora /usr/bin/top -b)
  34. # sudo docker attach $ID
  35. top - 02:05:52 up 3:05, 0 users, load average: 0.01, 0.02, 0.05
  36. Tasks: 1 total, 1 running, 0 sleeping, 0 stopped, 0 zombie
  37. 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
  38. Mem: 373572k total, 355560k used, 18012k free, 27872k buffers
  39. Swap: 786428k total, 0k used, 786428k free, 221740k cached
  40. PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
  41. 1 root 20 0 17200 1116 912 R 0 0.3 0:00.03 top
  42. top - 02:05:55 up 3:05, 0 users, load average: 0.01, 0.02, 0.05
  43. Tasks: 1 total, 1 running, 0 sleeping, 0 stopped, 0 zombie
  44. 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
  45. Mem: 373572k total, 355244k used, 18328k free, 27872k buffers
  46. Swap: 786428k total, 0k used, 786428k free, 221776k cached
  47. PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
  48. 1 root 20 0 17208 1144 932 R 0 0.3 0:00.03 top
  49. .RE
  50. .fi
  51. .sp
  52. .SH HISTORY
  53. April 2014, Originally compiled by William Henry (whenry at redhat dot com) based on dockier.io source material and internal work.