Skip to content

CMD vs ENTRYPOINT

Select an icon to see what it is.

Step 5 of 6

Exec form and shell form differ

The exec form, a JSON array, runs the program directly. The shell form, a plain string, runs it as /bin/sh -c, and a shell-form ENTRYPOINT ignores any CMD and any arguments you pass. The exec form is almost always the right choice, and it also lets the program receive signals as PID 1.

How each form is stored

ENTRYPOINT ["echo"] -> Entrypoint ["echo"]
ENTRYPOINT echo -> Entrypoint ["/bin/sh","-c","echo"] (CMD and arguments are ignored)