When I run a docker CLI command and send a SIGTERM signal to the process running the docker command, I would expect the process to exit with status 143 representing the SIGTERM but it actually exits with status 1. Why is this the case?
(shell 1)
$ docker run -it --rm alpine:latest sleep 1000
(shell 2)
$ ps | grep docker
75658 ttys000 0:00.03 docker run -it --rm alpine:latest sleep 1000
(shell 2)
$ kill -SIGTERM 75658
(shell 1)
...container stops running
$ echo $?
1 (was expecting 143)
On the other hand, it returns with the expected status (137) when I end the process with a SIGKILL.