You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jul 28, 2024. It is now read-only.
Question: Has Google handled the issues in the guide in some other way or is the best practice for a company to create their own node Docker image that implements these recommendations?
INIT Node.js was not designed to run as PID 1 which leads to unexpected behaviour when running inside of Docker. For example, a Node.js process running as PID 1 will not respond to SIGTERM (CTRL-C) and similar signals. As of Docker 1.13, you can use the --init flag to wrap your Node.js process with a lightweight init system that properly handles running as PID 1. docker run -it --init node
In the three areas docker run is referenced in this repo, --init node is not used
SIGTERM and SIGINT When creating an image, you can bypass the package.json's start command and bake it directly into the image itself. First off this reduces the number of processes running inside of your container. Secondly it causes exit signals such as SIGTERM and SIGINT to be received by the Node.js process instead of npm swallowing them.
The text was updated successfully, but these errors were encountered:
Bumping it. We want to be able to do a graceful shutdown by listening to the SIGTERM event. Currently, it's not possible to do so without a custom Dockerfile.
The ticket has been open for almost 4 years now. Why the GCP node.js image does not implement best practices?
Node.JS Foundation publishes a Docker Best Practices Guide. The guide references some recommended best practices that may not be implemented in GoogleCloudPlatform/nodejs-docker.
Question: Has Google handled the issues in the guide in some other way or is the best practice for a company to create their own node Docker image that implements these recommendations?
INIT
Node.js was not designed to run as PID 1 which leads to unexpected behaviour when running inside of Docker. For example, a Node.js process running as PID 1 will not respond to SIGTERM (CTRL-C) and similar signals. As of Docker 1.13, you can use the --init flag to wrap your Node.js process with a lightweight init system that properly handles running as PID 1.
docker run -it --init node
In the three areas
docker run
is referenced in this repo,--init node
is not usedSIGTERM and SIGINT
When creating an image, you can bypass the package.json's start command and bake it directly into the image itself. First off this reduces the number of processes running inside of your container. Secondly it causes exit signals such as SIGTERM and SIGINT to be received by the Node.js process instead of npm swallowing them.
The text was updated successfully, but these errors were encountered: