Docker Tip #16 - Making sure your process receives signals

When you are virtualizing your process using Docker there is one important thing to note if your process expects to be informed it needs to shutdown.

By default only the process with process id 1 receives signals from outside of the container. So in order for your application to receive them you need to make sure your process is either specified as the CMD or the shell script you use to start your process is a) invoked directly using CMD (e.g. CMD ./ and b) replacing the shell script when spawning your process using "exec".

So if you are using a shell script to bootstrap a Java process keep the 2 things mentioned above in mind.

Posted October 11, 2016