Add config parameter to change per-container stop timeout during daemon shutdown

This fix tries to add a flag `--stop-timeout` to specify the timeout value
(in seconds) for the container to stop before SIGKILL is issued. If stop timeout
is not specified then the default timeout (10s) is used.

Additional test cases have been added to cover the change.

This fix is related to #22471. Another pull request will add `--shutdown-timeout`
to daemon for #22471.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
This commit is contained in:
Yong Tang
2017-06-02 00:10:24 +00:00
committed by Tibor Vass
parent 83c7808f3a
commit 4ff84a13da
4 changed files with 15 additions and 0 deletions
+4
View File
@@ -68,6 +68,7 @@ docker-create - Create a new container
[**--security-opt**[=*[]*]]
[**--storage-opt**[=*[]*]]
[**--stop-signal**[=*SIGNAL*]]
[**--stop-timeout**[=*TIMEOUT*]]
[**--shm-size**[=*[]*]]
[**--sysctl**[=*[]*]]
[**-t**|**--tty**]
@@ -352,6 +353,9 @@ unit, `b` is used. Set LIMIT to `-1` to enable unlimited swap.
**--stop-signal**=*SIGTERM*
Signal to stop a container. Default is SIGTERM.
**--stop-timeout**=*10*
Timeout (in seconds) to stop a container. Default is 10.
**--sysctl**=SYSCTL
Configure namespaced kernel parameters at runtime
+4
View File
@@ -70,6 +70,7 @@ docker-run - Run a command in a new container
[**--security-opt**[=*[]*]]
[**--storage-opt**[=*[]*]]
[**--stop-signal**[=*SIGNAL*]]
[**--stop-timeout**[=*TIMEOUT*]]
[**--shm-size**[=*[]*]]
[**--sig-proxy**[=*true*]]
[**--sysctl**[=*[]*]]
@@ -502,6 +503,9 @@ incompatible with any restart policy other than `none`.
**--stop-signal**=*SIGTERM*
Signal to stop a container. Default is SIGTERM.
**--stop-timeout**=*10*
Timeout (in seconds) to stop a container. Default is 10.
**--shm-size**=""
Size of `/dev/shm`. The format is `<number><unit>`.
`number` must be greater than `0`. Unit is optional and can be `b` (bytes), `k` (kilobytes), `m`(megabytes), or `g` (gigabytes).