CMD and ENTRYPOINT when used together in a Dockerfile help us pass a program name (command) and arguments to the image.
The ENTRYPOINT is interpreted as the command and The CMD instruction as its argument:



Remark:

We could have more than one argument:


We can override the above arguments by passing our new argument(s) to the "docker run" command as below:


Overriding the "ENTRYPOINT" and "CMD" in Kubernetes:

We can override the ENTRYPOINT and CMD in a kubernetes Yaml config file, in the container section of a pod using the command and args variables as you can see below:



Brando Sabatini and Ikbal C ©. Powered by Blogger.