K:Kubernetes/Docker EntryPoint and Cmd
In Docker: ENTRYPOINT : Defines the main command that runs when the container starts. It cannot be easily overridden directly from the command line. CMD : Provides default arguments for the ENTRYPOINT or defines a command to run if no ENTRYPOINT is specified. It can be overridden by passing arguments to docker run . In Kubernetes: command (in the Pod specification): This field overrides the ENTRYPOINT specified in the Dockerfile. args (in the Pod specification): This field overrides the CMD specified in the Dockerfile. Example Dockerfile: Dockerfile FROM ubuntu ENTRYPOINT ["echo"] CMD ["Hello, World!"] Running with Docker: Default behavior: docker run myimage will output Hello, World! . Overriding CMD : docker run myimage Kubernetes will output Kubernetes . Overriding ENTRYPOINT : Not directly possible via command line (requires a change in the Dockerfile or using the --entrypoint flag). Running in Kubernetes: yaml apiVersion: v1 kind: Pod metadata: ...