Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wrap Node.js server with tini in Docker image #367

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

dtan4
Copy link

@dtan4 dtan4 commented Oct 23, 2017

We cannot stop elasticsearch-head Docker container gracefully, because Node.js in Docker container cannot handle kernel signal (SIGINT, SIGTERM and so on).
https://github.com/nodejs/docker-node/blob/078ff84cb756df33fe3444090914e65a0721c9fd/docs/BestPractices.md#handling-kernel-signals

To handle these signals, we have to wrap Node.js process with lightweight init system, for example tini, or use docker run --init flag.
However, Kubernetes does not support this flag.

I added some steps to install tini in elasticsearch-head Docker image. All Docker users will be able to stop gracefully by this change.

@dtan4 dtan4 changed the title Wrap Node.js server with tini Wrap Node.js server with tini in Docker image Oct 23, 2017
@rejinka
Copy link

rejinka commented Oct 24, 2017

Did you take a look at #362? I think this should also solve your problem with the kernel signals. As a plus, it shrinks the image to 2% of its original size :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants