瀏覽代碼

Fix kernel memory updating docs

Specify that kernel memory updating limitation only applies
on kernel version older than 4.6.

Signed-off-by: Qiang Huang <h.huangqiang@huawei.com>
Qiang Huang 9 年之前
父節點
當前提交
59069ba29a
共有 2 個文件被更改,包括 23 次插入15 次删除
  1. 9 6
      docs/reference/commandline/update.md
  2. 14 9
      man/docker-update.1.md

+ 9 - 6
docs/reference/commandline/update.md

@@ -37,9 +37,9 @@ limits on a single container or on many. To specify more than one container,
 provide space-separated list of container names or IDs.
 
 With the exception of the `--kernel-memory` option, you can specify these
-options on a running or a stopped container. You can only update
-`--kernel-memory` on a stopped container or on a running container with
-kernel memory initialized.
+options on a running or a stopped container. On kernel version older than
+4.6, you can only update `--kernel-memory` on a stopped container or on
+a running container with kernel memory initialized.
 
 ## EXAMPLES
 
@@ -66,9 +66,10 @@ $ docker update --cpu-shares 512 -m 300M abebf7571666 hopeful_morse
 ### Update a container's kernel memory constraints
 
 You can update a container's kernel memory limit using the `--kernel-memory`
-option. This option can be updated on a running container only if the container
-was started with `--kernel-memory`. If the container was started *without*
-`--kernel-memory` you need to stop the container before updating kernel memory.
+option. On kernel version older than 4.6, this option can be updated on a
+running container only if the container was started with `--kernel-memory`.
+If the container was started *without* `--kernel-memory` you need to stop
+the container before updating kernel memory.
 
 For example, if you started a container with this command:
 
@@ -92,6 +93,8 @@ Update kernel memory of running container `test2` will fail. You need to stop
 the container before updating the `--kernel-memory` setting. The next time you
 start it, the container uses the new value.
 
+Kernel version newer than (include) 4.6 does not have this limitation, you
+can use `--kernel-memory` the same way as other options.
 
 ### Update a container's restart policy
 

+ 14 - 9
man/docker-update.1.md

@@ -29,9 +29,9 @@ limits on a single container or on many. To specify more than one container,
 provide space-separated list of container names or IDs.
 
 With the exception of the **--kernel-memory** option, you can specify these
-options on a running or a stopped container. You can only update
-**--kernel-memory** on a stopped container or on a running container with
-kernel memory initialized.
+options on a running or a stopped container. On kernel version older than
+4.6, You can only update **--kernel-memory** on a stopped container or on
+a running container with kernel memory initialized.
 
 # OPTIONS
 
@@ -59,9 +59,10 @@ kernel memory initialized.
 **--kernel-memory**=""
    Kernel memory limit (format: `<number>[<unit>]`, where unit = b, k, m or g)
 
-   Note that you can not update kernel memory on a running container if the container
-   is started without kernel memory initialized, in this case, it can only be updated
-   after it's stopped. The new setting takes effect when the container is started.
+   Note that on kernel version older than 4.6, you can not update kernel memory on
+   a running container if the container is started without kernel memory initialized,
+   in this case, it can only be updated after it's stopped. The new setting takes
+   effect when the container is started.
 
 **-m**, **--memory**=""
    Memory limit (format: <number><optional unit>, where unit = b, k, m or g)
@@ -100,9 +101,10 @@ $ docker update --cpu-shares 512 -m 300M abebf7571666 hopeful_morse
 ### Update a container's kernel memory constraints
 
 You can update a container's kernel memory limit using the **--kernel-memory**
-option. This option can be updated on a running container only if the container
-was started with **--kernel-memory**. If the container was started *without*
-**--kernel-memory** you need to stop the container before updating kernel memory.
+option. On kernel version older than 4.6, this option can be updated on a
+running container only if the container was started with **--kernel-memory**.
+If the container was started *without* **--kernel-memory** you need to stop
+the container before updating kernel memory.
 
 For example, if you started a container with this command:
 
@@ -126,6 +128,9 @@ Update kernel memory of running container `test2` will fail. You need to stop
 the container before updating the **--kernel-memory** setting. The next time you
 start it, the container uses the new value.
 
+Kernel version newer than (include) 4.6 does not have this limitation, you
+can use `--kernel-memory` the same way as other options.
+
 ### Update a container's restart policy
 
 You can change a container's restart policy on a running container. The new