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

pressing ctrl-c does not result in aborting node #1926

Open
keerden opened this issue Jun 27, 2023 · 1 comment
Open

pressing ctrl-c does not result in aborting node #1926

keerden opened this issue Jun 27, 2023 · 1 comment

Comments

@keerden
Copy link

keerden commented Jun 27, 2023

Environment

  • Platform: Debian 10
  • Docker Version: 20.10.17
  • Node.js Version: 20.3.1
  • Image Tag: node:20.3-Alpine3.18

Expected Behavior

Pressing ctrl-c when running a simple nodejs script should emit a sigint and stop node.

Current Behavior

Pressing ctrl-c is ignored

Steps to Reproduce

Create in a empty dir the following files:

Dockerfile:

FROM node:20.3-alpine3.18
COPY . .
RUN npm install
CMD [ "npm", "start" ]

package.json

{
  "name": "test",
  "version": "1.0.0",
  "main": "test.js",
  "scripts": {
    "start": "node test.js"
  }
}

test.js

'use strict';

console.log("test");

for (let i=0; i<10; i++) {
    task(i);
 }
   
 function task(i) {
   setTimeout(function() {
       console.log(i);
   }, 2000 * i);
 }

build a docker image with docker build -t test .

run the image with docker run test

press ctrl-c to abort, nothing happens

Additional Information

Works on node:20.2-Alpine3.18

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

No branches or pull requests

2 participants