Browse code

docs: cleanup docker update docs

move the "kernel memory" examples to the "examples" section,
and fix some formatting and grammar.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>

Sebastiaan van Stijn authored on 2016/07/12 21:29:02
Showing 2 changed files
... ...
@@ -31,44 +31,25 @@ Options:
31 31
 ```
32 32
 
33 33
 The `docker update` command dynamically updates container configuration.
34
-You can use this command to prevent containers from consuming too many resources
35
-from their Docker host.  With a single command, you can place limits on
36
-a single container or on many. To specify more than one container, provide
37
-space-separated list of container names or IDs.
34
+You can use this command to prevent containers from consuming too many 
35
+resources from their Docker host.  With a single command, you can place 
36
+limits on a single container or on many. To specify more than one container,
37
+provide space-separated list of container names or IDs.
38 38
 
39
-With the exception of the `--kernel-memory` value, you can specify these
39
+With the exception of the `--kernel-memory` option, you can specify these
40 40
 options on a running or a stopped container. You can only update
41 41
 `--kernel-memory` on a stopped container or on a running container with
42
-kernel memory initialized. For example, if you started a container with
43
-command:
44
-
45
-    # docker run -ti --name test --kernel-memory 50M ubuntu bash
46
-
47
-You can update kernel memory of this running container:
48
-
49
-    # docker update --kernel-memory 80M test
50
-
51
-If you started a container without kernel memory initialized:
52
-
53
-    # docker run -ti --name test2 --memory 300M ubuntu bash
54
-
55
-Update kernel memory of running container `test2` will fail, you can only
56
-stop the container and update kernel memory then. The next time you
57
-restart it, the container uses the new value.
58
-
59
-Another configuration you can change with this command is restart policy,
60
-new restart policy will take effect instantly after you run `docker update`
61
-on a container.
42
+kernel memory initialized.
62 43
 
63 44
 ## EXAMPLES
64 45
 
65 46
 The following sections illustrate ways to use this command.
66 47
 
67
-### Update a container with cpu-shares=512
48
+### Update a container's cpu-shares
68 49
 
69 50
 To limit a container's cpu-shares to 512, first identify the container
70
-name or ID. You can use **docker ps** to find these values. You can also
71
-use the ID returned from the **docker run** command.  Then, do the following:
51
+name or ID. You can use `docker ps` to find these values. You can also
52
+use the ID returned from the `docker run` command.  Then, do the following:
72 53
 
73 54
 ```bash
74 55
 $ docker update --cpu-shares 512 abebf7571666
... ...
@@ -82,9 +63,44 @@ To update multiple resource configurations for multiple containers:
82 82
 $ docker update --cpu-shares 512 -m 300M abebf7571666 hopeful_morse
83 83
 ```
84 84
 
85
+### Update a container's kernel memory constraints
86
+
87
+You can update a container's kernel memory limit using the `--kernel-memory`
88
+option. This option can be updated on a running container only if the container
89
+was started with `--kernel-memory`. If the container was started *without*
90
+`--kernel-memory` you need to stop the container before updating kernel memory.
91
+
92
+For example, if you started a container with this command:
93
+
94
+```bash
95
+$ docker run -dit --name test --kernel-memory 50M ubuntu bash
96
+```
97
+
98
+You can update kernel memory while the container is running:
99
+
100
+```bash
101
+$ docker update --kernel-memory 80M test
102
+```
103
+
104
+If you started a container *without* kernel memory initialized:
105
+
106
+```bash
107
+$ docker run -dit --name test2 --memory 300M ubuntu bash
108
+```
109
+
110
+Update kernel memory of running container `test2` will fail. You need to stop
111
+the container before updating the `--kernel-memory` setting. The next time you
112
+start it, the container uses the new value.
113
+
114
+
85 115
 ### Update a container's restart policy
86 116
 
117
+You can change a container's restart policy on a running container. The new
118
+restart policy takes effect instantly after you run `docker update` on a
119
+container.
120
+
87 121
 To update restart policy for one or more containers:
122
+
88 123
 ```bash
89 124
 $ docker update --restart=on-failure:3 abebf7571666 hopeful_morse
90 125
 ```
... ...
@@ -22,37 +22,19 @@ CONTAINER [CONTAINER...]
22 22
 
23 23
 # DESCRIPTION
24 24
 
25
-The `docker update` command dynamically updates container configuration.
26
-you can Use this command to prevent containers from consuming too many 
25
+The **docker update** command dynamically updates container configuration.
26
+You can use this command to prevent containers from consuming too many 
27 27
 resources from their Docker host.  With a single command, you can place 
28 28
 limits on a single container or on many. To specify more than one container,
29 29
 provide space-separated list of container names or IDs.
30 30
 
31
-With the exception of the `--kernel-memory` value, you can specify these
31
+With the exception of the **--kernel-memory** option, you can specify these
32 32
 options on a running or a stopped container. You can only update
33
-`--kernel-memory` on a stopped container or on a running container with
34
-kernel memory initialized. For example, if you started a container with
35
-command:
36
-
37
-    # docker run -ti --name test --kernel-memory 50M ubuntu bash
38
-
39
-You can update kernel memory of this running container:
40
-
41
-    # docker update --kernel-memory 80M test
42
-
43
-If you started a container without kernel memory initialized:
44
-
45
-    # docker run -ti --name test2 --memory 300M ubuntu bash
46
-
47
-Update kernel memory of running container `test2` will fail, you can only
48
-stop the container and update kernel memory then. The next time you
49
-restart it, the container uses the new value.
50
-
51
-Another configuration you can change with this command is restart policy,
52
-new restart policy will take effect instantly after you run `docker update`
53
-on a container.
33
+**--kernel-memory** on a stopped container or on a running container with
34
+kernel memory initialized.
54 35
 
55 36
 # OPTIONS
37
+
56 38
 **--blkio-weight**=0
57 39
    Block IO weight (relative weight) accepts a weight value between 10 and 1000.
58 40
 
... ...
@@ -77,9 +59,9 @@ on a container.
77 77
 **--kernel-memory**=""
78 78
    Kernel memory limit (format: `<number>[<unit>]`, where unit = b, k, m or g)
79 79
 
80
-   Note that you can not update kernel memory to a running container if the container
81
-is started without kernel memory initialized, in this case, it can only be updated
82
-after it's stopped, and affect after it's started.
80
+   Note that you can not update kernel memory on a running container if the container
81
+   is started without kernel memory initialized, in this case, it can only be updated
82
+   after it's stopped. The new setting takes effect when the container is started.
83 83
 
84 84
 **-m**, **--memory**=""
85 85
    Memory limit (format: <number><optional unit>, where unit = b, k, m or g)
... ...
@@ -97,7 +79,7 @@ after it's stopped, and affect after it's started.
97 97
 
98 98
 The following sections illustrate ways to use this command.
99 99
 
100
-### Update a container with cpu-shares=512
100
+### Update a container's cpu-shares
101 101
 
102 102
 To limit a container's cpu-shares to 512, first identify the container
103 103
 name or ID. You can use **docker ps** to find these values. You can also
... ...
@@ -115,9 +97,43 @@ To update multiple resource configurations for multiple containers:
115 115
 $ docker update --cpu-shares 512 -m 300M abebf7571666 hopeful_morse
116 116
 ```
117 117
 
118
+### Update a container's kernel memory constraints
119
+
120
+You can update a container's kernel memory limit using the **--kernel-memory**
121
+option. This option can be updated on a running container only if the container
122
+was started with **--kernel-memory**. If the container was started *without*
123
+**--kernel-memory** you need to stop the container before updating kernel memory.
124
+
125
+For example, if you started a container with this command:
126
+
127
+```bash
128
+$ docker run -dit --name test --kernel-memory 50M ubuntu bash
129
+```
130
+
131
+You can update kernel memory while the container is running:
132
+
133
+```bash
134
+$ docker update --kernel-memory 80M test
135
+```
136
+
137
+If you started a container *without* kernel memory initialized:
138
+
139
+```bash
140
+$ docker run -dit --name test2 --memory 300M ubuntu bash
141
+```
142
+
143
+Update kernel memory of running container `test2` will fail. You need to stop
144
+the container before updating the **--kernel-memory** setting. The next time you
145
+start it, the container uses the new value.
146
+
118 147
 ### Update a container's restart policy
119 148
 
149
+You can change a container's restart policy on a running container. The new
150
+restart policy takes effect instantly after you run `docker update` on a
151
+container.
152
+
120 153
 To update restart policy for one or more containers:
154
+
121 155
 ```bash
122 156
 $ docker update --restart=on-failure:3 abebf7571666 hopeful_morse
123 157
 ```