Docker and CI/CD · Junior · Question 6 of 75
How does ENTRYPOINT relate to CMD?
- 1
ENTRYPOINTruns at build time, andCMDruns at container start - ✓Correct answer:
ENTRYPOINTis the executable;CMDgives its default arguments - 3
ENTRYPOINTis the older name ofCMD, kept only for compatibility
Explanation
With ENTRYPOINT ["node"] and CMD ["server.js"], docker run image other.js replaces only the arguments. Without ENTRYPOINT, run arguments replace CMD entirely.