diff --git a/docs/reference/builder.md b/docs/reference/builder.md index 3a73b87d..19513975 100644 --- a/docs/reference/builder.md +++ b/docs/reference/builder.md @@ -158,6 +158,7 @@ the `Dockerfile`: * `USER` * `WORKDIR` * `VOLUME` +* `STOPSIGNAL` as well as: @@ -1012,6 +1013,14 @@ For example you might add something like this: > **Warning**: The `ONBUILD` instruction may not trigger `FROM` or `MAINTAINER` instructions. +## STOPSIGNAL + + STOPSIGNAL signal + +The `STOPSIGNAL` instruction 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. + ## Dockerfile examples # Nginx diff --git a/docs/reference/commandline/create.md b/docs/reference/commandline/create.md index 74d5185a..7c64d729 100644 --- a/docs/reference/commandline/create.md +++ b/docs/reference/commandline/create.md @@ -61,6 +61,7 @@ Creates a new container. --read-only=false Mount the container's root filesystem as read only --restart="no" Restart policy (no, on-failure[:max-retry], always, unless-stopped) --security-opt=[] Security options + --stop-signal="SIGTERM" Signal to stop a container -t, --tty=false Allocate a pseudo-TTY --disable-content-trust=true Skip image verification -u, --user="" Username or UID diff --git a/docs/reference/commandline/run.md b/docs/reference/commandline/run.md index 6ee97906..c7726497 100644 --- a/docs/reference/commandline/run.md +++ b/docs/reference/commandline/run.md @@ -62,6 +62,7 @@ weight=1 --restart="no" Restart policy (no, on-failure[:max-retry], always, unless-stopped) --rm=false Automatically remove the container when it exits --security-opt=[] Security Options + --stop-signal="SIGTERM" Signal to stop a container --sig-proxy=true Proxy received signals to the process -t, --tty=false Allocate a pseudo-TTY -u, --user="" Username or UID (format: [:]) @@ -531,3 +532,9 @@ containers with `daemon` user: The 4th container fails and reports "[8] System error: resource temporarily unavailable" error. This fails because the caller set `nproc=3` resulting in the first three containers using up the three processes quota set for the `daemon` user. + +### Stopping a container with a specific 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. diff --git a/man/docker-inspect.1.md b/man/docker-inspect.1.md index e289899b..f7faf4a7 100644 --- a/man/docker-inspect.1.md +++ b/man/docker-inspect.1.md @@ -181,7 +181,7 @@ To get information on a container use its ID or instance name: "MemorySwap": 0, "CpuShares": 0, "Cpuset": "", - "StopSignal": 15, + "StopSignal": "SIGTERM" } } ]