1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00
moby--moby/api/types/container
Sebastiaan van Stijn 83a185897d
API: add "signal" parameter to container stop and restart endpoints
Containers can have a default stop-signal (`--stop-signal` / `STOPSIGNAL`) and
timeout (`--stop-timeout`). It is currently not possible to update either of
these after the container is created (`docker update` does not allow updating
them), and while either of these can be overridden through some commands, we
currently do not have a command that can override *both*:

command         | stop-signal | stop-timeout | notes
----------------|-------------|--------------|----------------------------
docker kill     | yes         | DNA          | only sends a single signal
docker restart  | no          | yes          |
docker stop     | no          | yes          |

As a result, if a user wants to stop a container with a custom signal and
timeout, the only option is to do this manually:

    docker kill -s <custom signal> mycontainer
    # wait <desired timeout>
    # press ^C to cancel the graceful stop
    # forcibly kill the container
    docker kill mycontainer

This patch adds a new `signal` query parameter to the container "stop" and
"restart" endpoints. This parameter can be added as a new flag on the CLI,
which would allow stopping and restarting with a custom timeout and signal,
for example:

    docker stop --signal=SIGWINCH --time=120 mycontainer

    docker restart --signal=SIGWINCH --time=120 mycontainer

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2022-04-20 21:29:31 +02:00
..
config.go API: add "signal" parameter to container stop and restart endpoints 2022-04-20 21:29:31 +02:00
container_changes.go api/types: re-generate with new template 2019-11-05 11:32:41 -08:00
container_create.go api/types: re-generate with new template 2019-11-05 11:32:41 -08:00
container_top.go swagger: reformat, and wrap to ~80-chars 2020-05-02 18:10:28 +02:00
container_update.go api/types: re-generate with new template 2019-11-05 11:32:41 -08:00
container_wait_o_k_body.go api: swagger: move ContainerWaitResponse to definitions 2022-03-05 22:21:56 +01:00
container_wait_o_k_body_error.go api: swagger: move ContainerWaitResponse to definitions 2022-03-05 22:21:56 +01:00
host_config.go api/types: fix KernelMemory deprecation comment, and omitempty 2022-03-17 09:56:48 +01:00
hostconfig_unix.go Update to Go 1.17.0, and gofmt with Go 1.17 2021-08-24 23:33:27 +02:00
hostconfig_windows.go Add canonical import comment 2018-02-05 16:51:57 -05:00
waitcondition.go Add canonical import comment 2018-02-05 16:51:57 -05:00