Created
January 14, 2015 00:26
-
-
Save thockin/c44a88b84c2a1041a1bd to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
``` | |
| No ENTRYPOINT | ENTRYPOINT entry | ENTRYPOINT ["entry"] | | |
------------+-----------------+------------------------------ ---+-----------------------| | |
No CMD | <error> | /bin/sh -c entry | entry | | |
CMD cmd | /bin/sh -c cmd | /bin/sh -c entry /bin/sh -c cmd | entry /bin/sh -c cmd | | |
CMD ["cmd"] | cmd | /bin/sh -c entry cmd | entry cmd | | |
------------------------------------------------------------------------------------------ | |
``` |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
An additional dimension is missing:
Are command-line args provided to "docker run CONTAINER" or not (and should they be used or ignored).
In this case only both exec modes (lower right cell) works as expected for me.
Therefore, there are only 2 use cases (IMHO, independent of the combinations above):
=> USE: Both exec mode.
=> USE: Other cases (but use either only CMD or only ENTRYPOINT for readability/clarity).
BETTER: Use only ENTRYPOINT in shell mode (other cases lead to weird problems).