What is the difference between Docker RUN, CMD and ENTRYPOINT?

Technology CommunityCategory: DockerWhat is the difference between Docker RUN, CMD and ENTRYPOINT?
VietMX Staff asked 3 years ago

CMD does not execute anything at build time, but specifies the intended command for the image.
RUN actually runs a command and commits the result.
If you would like your container to run the same executable every time, then you should consider using ENTRYPOINT in combination with CMD.