Adds a STOPSIGNAL
instruction to set the system call signal that will be
sent to the container to exit.
Details
The STOPSIGNAL
instruction sets the system call signal that will be sent to
the container to request it to exit. The signal can be specified as a signal name
in the format SIGNAME
(e.g., SIGTERM
), or as an unsigned number (e.g., 15
).
By default, Docker sends SIGTERM
to containers when they need to be stopped.
If the container doesn't exit within the timeout period (default 10 seconds),
Docker sends SIGKILL
to forcibly terminate it.
See also
dfi_healthcheck()
for configuring container health checks &
Official Docker STOPSIGNAL
documentation
Other dockerfile instruction functions:
dfi_add()
,
dfi_arg()
,
dfi_cmd()
,
dfi_copy()
,
dfi_entrypoint()
,
dfi_env()
,
dfi_expose()
,
dfi_from()
,
dfi_healthcheck()
,
dfi_label()
,
dfi_maintainer()
,
dfi_onbuild()
,
dfi_run()
,
dfi_shell()
,
dfi_user()
,
dfi_volume()
,
dfi_workdir()
Examples
# Set SIGTERM as the stop signal
df <- dockerfile() |>
dfi_from("rocker/r-ver:4.4.0") |>
dfi_stopsignal("SIGTERM")
df
#> FROM rocker/r-ver:4.4.0
#> STOPSIGNAL SIGTERM
# Set using signal number
df <- dockerfile() |>
dfi_from("rocker/r-ver:4.4.0") |>
dfi_stopsignal("15")
df
#> FROM rocker/r-ver:4.4.0
#> STOPSIGNAL 15