github.com/kaisenlinux/docker.io@v0.0.0-20230510090727-ea55db55fac7/cli/docs/reference/commandline/kill.md (about)

     1  ---
     2  title: "kill"
     3  description: "The kill command description and usage"
     4  keywords: "container, kill, signal"
     5  ---
     6  
     7  # kill
     8  
     9  ```markdown
    10  Usage:  docker kill [OPTIONS] CONTAINER [CONTAINER...]
    11  
    12  Kill one or more running containers
    13  
    14  Options:
    15        --help            Print usage
    16    -s, --signal string   Signal to send to the container (default "KILL")
    17  ```
    18  
    19  ## Description
    20  
    21  The `docker kill` subcommand kills one or more containers. The main process
    22  inside the container is sent `SIGKILL` signal (default), or the signal that is
    23  specified with the `--signal` option. You can reference a container by its
    24  ID, ID-prefix, or name.
    25  
    26  The `--signal` (or `-s` shorthand) flag sets the system call signal that is sent
    27  to the container. This signal can be a signal name in the format `SIG<NAME>`, for
    28  instance `SIGINT`, or an unsigned number that matches a position in the kernel's
    29  syscall table, for instance `2`.
    30  
    31  While the default (`SIGKILL`) signal will terminate the container, the signal
    32  set through `--signal` may be non-terminal, depending on the container's main
    33  process. For example, the `SIGHUP` signal in most cases will be non-terminal,
    34  and the container will continue running after receiving the signal.
    35  
    36  > **Note**
    37  >
    38  > `ENTRYPOINT` and `CMD` in the *shell* form run as a child process of
    39  > `/bin/sh -c`, which does not pass signals. This means that the executable is
    40  > not the container’s PID 1 and does not receive Unix signals.
    41  
    42  ## Examples
    43  
    44  
    45  ### Send a KILL signal to a container
    46  
    47  The following example sends the default `SIGKILL` signal to the container named
    48  `my_container`:
    49  
    50  ```console
    51  $ docker kill my_container
    52  ```
    53  
    54  ### <a name="signal"></a> Send a custom signal to a container (--signal)
    55  
    56  The following example sends a `SIGHUP` signal to the container named
    57  `my_container`:
    58  
    59  ```console
    60  $ docker kill --signal=SIGHUP  my_container
    61  ```
    62  
    63  
    64  You can specify a custom signal either by _name_, or _number_. The `SIG` prefix
    65  is optional, so the following examples are equivalent:
    66  
    67  ```console
    68  $ docker kill --signal=SIGHUP my_container
    69  $ docker kill --signal=HUP my_container
    70  $ docker kill --signal=1 my_container
    71  ```
    72  
    73  Refer to the [`signal(7)`](https://man7.org/linux/man-pages/man7/signal.7.html)
    74  man-page for a list of standard Linux signals.