In Docker, when chaining several startup commands (CMD) in shell form, is there any advantage in using the shell's exec feature to replace it with the last command of the chain instead of just running it as a child process of the startup shell?
Here is an example:
CMD npm install && npm start
CMD npm install && exec npm start
I think in the latter example, the
npm start command will replace the shell as the PID 1 process. But I do not fully understand which advantages or disadvantages this would have.