In Chapter 2, DevOps with Containers, we learned there are two forms to invoke our program when writing a Dockerfile: the shell form and the exec form. The shell to run the shell form commands defaults to /bin/sh -c on Linux containers. Hence, there are a few questions related to whether SIGTERM can be received by our applications:
- How is our application invoked?
- What shell implementation is used in the image?
- How does the shell implementation deal with the -c parameter?
Let's approach these questions one by one. The Dockerfile used in the following example can be found here: https://github.com/PacktPublishing/DevOps-with-Kubernetes-Second-Edition/tree/master/chapter9/9-3_on_pods/graceful_docker ...