mirror of
https://github.com/docker/cli.git
synced 2025-07-30 17:03:07 +03:00
docs: rewrite reference docs for --stop-signal and --stop-timeout
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
@ -109,7 +109,7 @@ Options:
|
||||
Unit is optional and can be `b` (bytes), `k` (kilobytes), `m` (megabytes),
|
||||
or `g` (gigabytes). If you omit the unit, the system uses bytes.
|
||||
--stop-signal string Signal to stop a container (default "SIGTERM")
|
||||
--stop-timeout=10 Timeout (in seconds) to stop a container
|
||||
--stop-timeout int Timeout (in seconds) to stop a container
|
||||
--storage-opt value Storage driver options for the container (default [])
|
||||
--sysctl value Sysctl options (default map[])
|
||||
--tmpfs value Mount a tmpfs directory (default [])
|
||||
|
@ -20,8 +20,18 @@ Options:
|
||||
|
||||
The `docker kill` subcommand kills one or more containers. The main process
|
||||
inside the container is sent `SIGKILL` signal (default), or the signal that is
|
||||
specified with the `--signal` option. You can kill a container using the
|
||||
container's ID, ID-prefix, or name.
|
||||
specified with the `--signal` option. You can reference a container by its
|
||||
ID, ID-prefix, or name.
|
||||
|
||||
The `--signal` (or `-s` shorthand) flag sets the system call signal that is sent
|
||||
to the container. This signal can be a signal name in the format `SIG<NAME>`, for
|
||||
instance `SIGINT`, or an unsigned number that matches a position in the kernel's
|
||||
syscall table, for instance `2`.
|
||||
|
||||
While the default (`SIGKILL`) signal will terminate the container, the signal
|
||||
set through `--signal` may be non-terminal, depending on the container's main
|
||||
process. For example, the `SIGHUP` signal in most cases will be non-terminal,
|
||||
and the container will continue running after receiving the signal.
|
||||
|
||||
> **Note**
|
||||
>
|
||||
@ -32,16 +42,16 @@ container's ID, ID-prefix, or name.
|
||||
## Examples
|
||||
|
||||
|
||||
### Send a KILL signal to a container
|
||||
### Send a KILL signal to a container
|
||||
|
||||
The following example sends the default `KILL` signal to the container named
|
||||
The following example sends the default `SIGKILL` signal to the container named
|
||||
`my_container`:
|
||||
|
||||
```bash
|
||||
$ docker kill my_container
|
||||
```
|
||||
|
||||
### Send a custom signal to a container
|
||||
### Send a custom signal to a container
|
||||
|
||||
The following example sends a `SIGHUP` signal to the container named
|
||||
`my_container`:
|
||||
|
@ -120,7 +120,7 @@ Options:
|
||||
or `g` (gigabytes). If you omit the unit, the system uses bytes.
|
||||
--sig-proxy Proxy received signals to the process (default true)
|
||||
--stop-signal string Signal to stop a container (default "SIGTERM")
|
||||
--stop-timeout=10 Timeout (in seconds) to stop a container
|
||||
--stop-timeout int Timeout (in seconds) to stop a container
|
||||
--storage-opt value Storage driver options for the container (default [])
|
||||
--sysctl value Sysctl options (default map[])
|
||||
--tmpfs value Mount a tmpfs directory (default [])
|
||||
@ -745,9 +745,12 @@ the three processes quota set for the `daemon` user.
|
||||
|
||||
### Stop container with signal (--stop-signal)
|
||||
|
||||
The `--stop-signal` flag sets the system call signal that will be sent to the container to exit.
|
||||
This signal can be a valid unsigned number that matches a position in the kernel's syscall table, for instance 9,
|
||||
or a signal name in the format SIGNAME, for instance SIGKILL.
|
||||
The `--stop-signal` flag sets the system call signal that will be sent to the
|
||||
container to exit. This signal can be a signal name in the format `SIG<NAME>`,
|
||||
for instance `SIGKILL`, or an unsigned number that matches a position in the
|
||||
kernel's syscall table, for instance `9`.
|
||||
|
||||
The default is `SIGTERM` if not specified.
|
||||
|
||||
### Optional security options (--security-opt)
|
||||
|
||||
@ -756,8 +759,16 @@ The `credentialspec` must be in the format `file://spec.txt` or `registry://keyn
|
||||
|
||||
### Stop container with timeout (--stop-timeout)
|
||||
|
||||
The `--stop-timeout` flag sets the timeout (in seconds) that a pre-defined (see `--stop-signal`) system call
|
||||
signal that will be sent to the container to exit. After timeout elapses the container will be killed with SIGKILL.
|
||||
The `--stop-timeout` flag sets the number of seconds to wait for the container
|
||||
to stop after sending the pre-defined (see `--stop-signal`) system call signal.
|
||||
If the container does not exit after the timeout elapses, it is forcibly killed
|
||||
with a `SIGKILL` signal.
|
||||
|
||||
If `--stop-timeout` is set to `-1`, no timeout is applied, and the daemon will
|
||||
wait indefinitely for the container to exit.
|
||||
|
||||
The default is determined by the daemon, and is 10 seconds for Linux containers,
|
||||
and 30 seconds for Windows containers.
|
||||
|
||||
### Specify isolation technology for container (--isolation)
|
||||
|
||||
|
Reference in New Issue
Block a user