DevOps Classroom notes 20/May/2026

Shell form vs Exec FORM

  • When we use Shell form , internally it runs with /bin/sh -c <command>
RUN apt update  => /bin/sh -c apt update
RUN python test.py  => /bin/sh -c "python test.py"
  • When we use exec form it directly starts your executable
CMD ["python", "test.py"]  -> python test.py
  • If we want dynamic values from arguments or variables then only option is shell form
CMD ["wget", "$URL"] => This will not work
RUN wget ${URL} => This will work
  • EXEC FORM respects linux signals which allows docker engine to send signals during stop and restart or even terminate
  • CMD and ENTRYPOINT come into play when container is starting and thats where signals are essential

Published
Categorized as Uncategorized Tagged

By continuous learner

devops & cloud enthusiastic learner

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Please turn AdBlock off
Animated Social Media Icons by Acurax Responsive Web Designing Company

Discover more from Direct DevOps from Quality Thought

Subscribe now to keep reading and get access to the full archive.

Continue reading

Visit Us On FacebookVisit Us On LinkedinVisit Us On Youtube