Summary
commandin K8s is analogous toENTRYPOINTin Dockerargsin K8s is analogousCMDin Docker
In Docker:
CMD has three forms
CMD ["executable", "param1", "param2"]exec form, preferred formCMD ["param1", "param2"]defaults toENTRYPOINTCMD command param1 param2shell form
There can only be one CMD instruction in a Dockerfile.
The main purpose of CMD is to provide defaults for an executing container
Any arguments to docker run ... overrides CMD.
ENTRYPOINT has two forms
ENTRYPOINT ["executable", "param1", "param2"]exec form, preferred formENTRYPOINT command param1 param2shell form
An ENTRYPOINT allows you to configure a container that will run as an executable
Any arguments to docker run ... get appended after all elements in an exec form ENTRYPOINT, and will override all elements specified using CMD.
You can override the ENTRPOINT instruction using the docker run --entrypoint flag.