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 }}
Repository navigation
docker stop (SIGTERM) not sent to NodeJS process (v0.7.0) #2878
FROM ubuntu:12.04
RUN apt-get update
RUN apt-get install -y curl git
RUN ln -sf /bin/bash /bin/sh
# Install NodeJS
RUN curl https://raw.github.com/creationix/nvm/master/install.sh | HOME=/root sh
RUN source /root/.nvm/nvm.sh && nvm install 0.10.20
RUN source /root/.nvm/nvm.sh && nvm alias default 0.10.20
# Configure the service
CMD source /root/.nvm/nvm.sh && node -e 'process.on("SIGTERM", function(){console.log("SIGTERM");process.exit(0);}); setInterval(function(){},1000);'
Run with docker run -d <image>.
Attach with docker attach <container>.
Attempt to stop with docker stop <container>.
Note that 'SIGTERM' is never logged, and the stop times out and reverts to a kill.
However, if I run this outside a container and kill the Node process with kill <pid> it successfully receives the SIGTERM, logs and exits.
It appears that, for some reason, the Node process isn't getting the SIGTERM.
I've tested with the bash script in #2436 and everything works fine, so this isn't just outright 'docker stop is broken', but instead some kind of strange interaction between Docker and NodeJS.
@creack Do you have any update on this? You said on IRC you suspected it was something to do with init. We have Node processes which like to talk to Redis/Hipache, etc. as they're shutting down and they don't get the chance. :-(
Activity
crosbymichael commentedon Nov 26, 2013
ping @creack
codeaholics commentedon Nov 28, 2013
@creack Do you have any update on this? You said on IRC you suspected it was something to do with
init. We have Node processes which like to talk to Redis/Hipache, etc. as they're shutting down and they don't get the chance. :-(codeaholics commentedon Dec 2, 2013
ping @creack
crosbymichael commentedon Mar 6, 2014
dup of #2436