@@ -4,13 +4,13 @@ interactively. You can attach to the same contained process multiple times
44simultaneously, screen sharing style, or quickly view the progress of your
55detached process.
66
7- To stop a container, use ` CTRL-c ` . This key sequence sends ` SIGKILL ` to the
7+ To stop a container, use ` CTRL-c ` . This key sequence sends ** SIGKILL** to the
88container. You can detach from the container (and leave it running) using a
99configurable key sequence. The default sequence is ` CTRL-p CTRL-q ` . You
1010configure the key sequence using the ** --detach-keys** option or a configuration
1111file. See ** config-json(5)** for documentation on using a configuration file.
1212
13- It is forbidden to redirect the standard input of a ` docker attach ` command while
13+ It is forbidden to redirect the standard input of a ** docker attach** command while
1414attaching to a tty-enabled container (i.e.: launched with ` -t ` ).
1515
1616# Override the detach sequence
@@ -22,18 +22,18 @@ sequence, as a per-container override or as a configuration property on your
2222entire configuration.
2323
2424To override the sequence for an individual container, use the
25- ` --detach-keys="<sequence>" ` flag with the ` docker attach ` command. The format of
26- the ` <sequence> ` is either a letter [ a-Z] , or the ` ctrl- ` combined with any of
27- the following:
25+ ** --detach-keys** = * key * flag with the ** docker attach** command. The format of
26+ the * key * is either a letter [ a-Z] , or the ** ctrl** - * value * , where * value * is one
27+ of the following:
2828
29- * ` a-z ` (a single lowercase alpha character )
30- * ` @ ` (at sign)
31- * ` [ ` (left bracket)
32- * ` \\ ` (two backward slashes)
33- * ` _ ` (underscore)
34- * ` ^ ` (caret)
29+ * ** a-z** (a single lowercase alpha character )
30+ * ** @ ** (at sign)
31+ * ** [ ** (left bracket)
32+ * ** \\\\ ** (two backward slashes)
33+ * ** _ ** (underscore)
34+ * ** ^ ** (caret)
3535
36- These ` a ` , ` ctrl-a ` , ` X ` , or ` ctrl-\\ ` values are all examples of valid key
36+ These ** a ** , ** ctrl-a** , ** X ** , or ** ctrl-\\ ** values are all examples of valid key
3737sequences. To configure a different configuration default key sequence for all
3838containers, see ** docker(1)** .
3939
@@ -45,22 +45,22 @@ In this example the top command is run inside a container, from an image called
4545fedora, in detached mode. The ID from the container is passed into the ** docker
4646attach** command:
4747
48- $ ID=$(sudo docker run -d fedora /usr/bin/top -b)
48+ $ ID=$(sudo docker run -d ubuntu:20.04 /usr/bin/top -b)
4949 $ sudo docker attach $ID
50- top - 02:05:52 up 3:05 , 0 users, load average: 0.01 , 0.02 , 0.05
50+ top - 00:07:01 up 4:54 , 0 users, load average: 0.83 , 0.91 , 0.82
5151 Tasks: 1 total, 1 running, 0 sleeping, 0 stopped, 0 zombie
52- 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
53- Mem: 373572k total, 355560k used , 18012k free , 27872k buffers
54- Swap: 786428k total, 0k used, 786428k free, 221740k cached
55-
56- PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
57- 1 root 20 0 17200 1116 912 R 0 0.3 0:00.03 top
58-
59- top - 02:05:55 up 3:05 , 0 users, load average: 0.01 , 0.02 , 0.05
52+ % Cpu(s): 2.3 us, 1.6 sy, 0.0 ni, 95.9 id, 0.0 wa, 0.1 hi, 0.1 si, 0.0 st
53+ MiB Mem : 15846.2 total, 5729.2 free , 2592.5 used , 7524.4 buff/cache
54+ MiB Swap: 16384.0 total, 16384.0 free, 0.0 used. 12097.3 avail Mem
55+
56+ PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
57+ 1 root 20 0 5976 3256 2828 R 0.0 0.0 0:00.04 top
58+
59+ top - 00:07:04 up 4:54 , 0 users, load average: 0.76 , 0.89 , 0.81
6060 Tasks: 1 total, 1 running, 0 sleeping, 0 stopped, 0 zombie
61- 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
62- Mem: 373572k total, 355244k used , 18328k free , 27872k buffers
63- Swap: 786428k total, 0k used, 786428k free, 221776k cached
64-
65- PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
66- 1 root 20 0 17208 1144 932 R 0 0.3 0:00.03 top
61+ % Cpu(s): 2.0 us, 1.4 sy, 0.0 ni, 96.5 id, 0.0 wa, 0.1 hi, 0.0 si, 0.0 st
62+ MiB Mem : 15846.2 total, 5727.5 free , 2594.4 used , 7524.3 buff/cache
63+ MiB Swap: 16384.0 total, 16384.0 free, 0.0 used. 12095.6 avail Mem
64+
65+ PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
66+ 1 root 20 0 5976 3256 2828 R 0.0 0.0 0:00.04 top
0 commit comments