Interview Prep/Docker/Dockerfile Instructions & Builds

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

BeginnerConceptDockerfile Instructions & Builds
Answer

RUN executes at build time and commits a layer. CMD sets the default command (or default args) at container start and is replaced by arguments to docker run. ENTRYPOINT defines the executable that always runs; docker run arguments are appended to it unless you pass --entrypoint.

All Docker questions Roadmap: Docker & containers

More on Dockerfile Instructions & Builds