github.com/kinvolk/docker@v1.13.1/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  [**--detach-keys**[=*[]*]]
    10  [**--help**]
    11  [**--no-stdin**]
    12  [**--sig-proxy**[=*true*]]
    13  CONTAINER
    14  
    15  # DESCRIPTION
    16  The **docker attach** command allows you to attach to a running container using
    17  the container's ID or name, either to view its ongoing output or to control it
    18  interactively.  You can attach to the same contained process multiple times
    19  simultaneously, screen sharing style, or quickly view the progress of your
    20  detached process.
    21  
    22  To stop a container, use `CTRL-c`. This key sequence sends `SIGKILL` to the
    23  container. You can detach from the container (and leave it running) using a
    24  configurable key sequence. The default sequence is `CTRL-p CTRL-q`. You
    25  configure the key sequence using the **--detach-keys** option or a configuration
    26  file. See **config-json(5)** for documentation on using a configuration file.
    27  
    28  It is forbidden to redirect the standard input of a `docker attach` command while
    29  attaching to a tty-enabled container (i.e.: launched with `-t`).
    30  
    31  # OPTIONS
    32  **--detach-keys**=""
    33      Override the key sequence for detaching a container. Format is a single character `[a-Z]` or `ctrl-<value>` where `<value>` is one of: `a-z`, `@`, `^`, `[`, `,` or `_`.
    34  
    35  **--help**
    36    Print usage statement
    37  
    38  **--no-stdin**=*true*|*false*
    39     Do not attach STDIN. The default is *false*.
    40  
    41  **--sig-proxy**=*true*|*false*
    42     Proxy all received signals to the process (non-TTY mode only). SIGCHLD, SIGKILL, and SIGSTOP are not proxied. The default is *true*.
    43  
    44  # Override the detach sequence
    45  
    46  If you want, you can configure an override the Docker key sequence for detach.
    47  This is useful if the Docker default sequence conflicts with key sequence you
    48  use for other applications. There are two ways to define your own detach key
    49  sequence, as a per-container override or as a configuration property on  your
    50  entire configuration.
    51  
    52  To override the sequence for an individual container, use the
    53  `--detach-keys="<sequence>"` flag with the `docker attach` command. The format of
    54  the `<sequence>` is either a letter [a-Z], or the `ctrl-` combined with any of
    55  the following:
    56  
    57  * `a-z` (a single lowercase alpha character )
    58  * `@` (at sign)
    59  * `[` (left bracket)
    60  * `\\` (two backward slashes)
    61  *  `_` (underscore)
    62  * `^` (caret)
    63  
    64  These `a`, `ctrl-a`, `X`, or `ctrl-\\` values are all examples of valid key
    65  sequences. To configure a different configuration default key sequence for all
    66  containers, see **docker(1)**.
    67  
    68  # EXAMPLES
    69  
    70  ## Attaching to a container
    71  
    72  In this example the top command is run inside a container, from an image called
    73  fedora, in detached mode. The ID from the container is passed into the **docker
    74  attach** command:
    75  
    76      # ID=$(sudo docker run -d fedora /usr/bin/top -b)
    77      # sudo docker attach $ID
    78      top - 02:05:52 up  3:05,  0 users,  load average: 0.01, 0.02, 0.05
    79      Tasks:   1 total,   1 running,   0 sleeping,   0 stopped,   0 zombie
    80      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
    81      Mem:    373572k total,   355560k used,    18012k free,    27872k buffers
    82      Swap:   786428k total,        0k used,   786428k free,   221740k cached
    83  
    84      PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND
    85      1 root      20   0 17200 1116  912 R    0  0.3   0:00.03 top
    86  
    87      top - 02:05:55 up  3:05,  0 users,  load average: 0.01, 0.02, 0.05
    88      Tasks:   1 total,   1 running,   0 sleeping,   0 stopped,   0 zombie
    89      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
    90      Mem:    373572k total,   355244k used,    18328k free,    27872k buffers
    91      Swap:   786428k total,        0k used,   786428k free,   221776k cached
    92  
    93      PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND
    94      1 root      20   0 17208 1144  932 R    0  0.3   0:00.03 top
    95  
    96  # HISTORY
    97  April 2014, Originally compiled by William Henry (whenry at redhat dot com)
    98  based on docker.com source material and internal work.
    99  June 2014, updated by Sven Dowideit <SvenDowideit@home.org.au>