Rather then going into the technical details of What are those, I will go with simple explanation of these 2 buddies, I hope this will help you to better understand these buggers :)
- Either of them, if used alone, is responsible for executing the command within container
- So either use ENTRYPOINT or CMD both will run the command mentioned in it.
- CMD ["nginx", "-g", "daemon off;"] # OR
- ENTRYPOINT ["nginx", "-g", "daemon off;"]
- We can override the CMD command in command
- docker run <image> <cmd>
- and similarly, we can override the ENTRYPOINT as well
- docker run --entrypoint <entrypoint_cmd> <image>
- But if we used them together, the behave like below -
- <entrypoint_cmd> <cmd>
So if you want your user to override the entry command, use CMD, it is comparatively easy to override in command line than ENTRYPOINT.
Like the below page to get the update
Facebook Page Facebook Group Twitter Feed Telegram Group
No comments:
Post a Comment