When my Docker file ends in
CMD node .
docker starts this container with a command /bin/sh -c "node ."instead of just node .(I know, I could do it with CMD ["node", "."]).
I thought this behavior was really nice, as it means PID1there is /bin/sh, rather than my modest node script inside the container .
If I understand correctly, Iโm PID1responsible for reaping the orphan processes of zombies, and I really donโt answer for it ... So if I /bin/shcan do this, that would be good. (I really thought that was the reason why docker was rewriting mine CMD).
The problem is that when I send SIGTERMto the container (starting with /bin/sh -c "node ."), either through docker-composer stop, or docker-composer kill -s SIGTERM, the signal does not reach my process node, and therefore it gets forcibly killed every time using SIGKILLafter a 10-second grace period. Not nice.
Is there a way for someone to control my zombies and for my node instance to receive signals sent by docker?
Roman source
share