SIGTERM isn't sent to the application process

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 ...

Get DevOps with Kubernetes - Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.