SIGTERM
is the default signal sent to containers to stop them: https://docs.docker.com/engine/reference/commandline/stop/
STOPSIGNAL
does allow you to override the default signal sent to the container. Leaving it out of the Dockerfile causes no harm – it will remain the default of SIGTERM
.
This being said, it is unclear why the author has explicitly defined the STOPSIGNAL
as SIGTERM
.
Looking at this commit, we can see that the STOPSIGNAL
used to be set to SIGQUIT
.
My guess is that they left it in explicitly for documentation’s sake after making the change.
Discussion of the change here: https://github.com/nginxinc/docker-nginx/issues/167