How to explicitly kill the process with PID 1 from inside a container?
PID 1 is a special PID which will ignore certain signals unless handlers are explicitly created. Docker has some documentation on this:


  Note: A process running as PID 1 inside a container is treated specially by Linux: it ignores any signal with the default action. So, the process will not terminate on SIGINT or SIGTERM unless it is coded to do so.


From here: https://docs.docker.com/engine/reference/run/#foreground

To kill PID 1 you will have to explicitly declare the handler for the SIGTERM signal or, in current versions of Docker, pass the --init flag in the docker run command to instrument tini.