Docker and CI/CD · Middle · Question 5 of 75

What is the difference between CMD ["node", "server.js"] and CMD node server.js?

Explanation

In shell form, the shell is PID 1 and usually doesn't forward SIGTERM, so docker stop waits for the timeout and kills the app without a graceful shutdown.

Further reading

Problem with a question

Docker and CI/CD · Middle · question 5

Test yourself

Take the Docker and CI/CD · Middle quiz: questions and options are shuffled, and you get a review of your mistakes at the end.

Take this quiz