Docker cmd can replace all the functions of entrypoint.
ENTRYPOINT
The format andRUN
Instruction format, divided intoexec
Format andshell
Format.ENTRYPOINT
The purpose andCMD
Similarly, the procedure and parameters for starting the container are all specified.ENTRYPOINT
It can also be replaced at run time, but it is better thanCMD
It’s a bit cumbersome and needs to be passeddocker run
Parameters of--entrypoint
To specify.
When specifiedENTRYPOINT
After that,CMD
The meaning of the has changed, is no longer directly run its command, but will beCMD
The contents of the are passed as parameters to theENTRYPOINT
The command, in other words, when actually executed, will become: < ENTRYPOINT> “<CMD > “