Skip to content

Node.js cannot receive signals like SIGTERM #550

Description

@WesCossick

Currently, the Node.js distroless container runs the Node.js process as PID 1:

# ps
PID   USER     TIME  COMMAND
    1 root      0:00 /nodejs/bin/node
   27 root      0:00 sh
   33 root      0:00 ps

According to Node.js's best practices:

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 SIGINT (CTRL-C) and similar signals.

So basically, Node.js apps won't receive SIGTERM, SIGINT, etc. when running inside gcr.io/distroless/nodejs.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions