A few rules applied when using Entrypoint and CMD
- must specify at least 1 of them
- Use CMD to define default executable but its easily overwritable by
docker run imagename overwrite-cmd-here
- Use ENTRYPOINT when you want the user to use the executable defined. Although its still possible to overwrite entrypoint by passing in
--entrypoint
its a bit harder than CMD - To have the ability to combine CMD and ENTRYPOINT, make sure you use the exec format instead of the shell format
To allow user pass in commandline argument during docker run
Dockerfile