When you run a process with “ENTRYPOINT” or “CMD” in a Docker container, it will be assigned to PID 1. As you saw in the last episode, this can introduce some issues with apps receiving certain process signals from Linux.
To work around this and create an environment where your container process does not have to run as PID 1, there are several options available. The one that I prefer is the use of a small script called “dumb-init”.
This script, from the Yelp team, will run as PID 1 and forward all signals to your actual process, among other things.
In this episode, you'll learn how to take advantage of dumb-init. You'll also see how to use the “RUN” command in a Dockerfile, which allows you to run any arbitrary command during an image build.