Kubernetes 101 : Adding the "ENTRYPOINT" parameters in the deployment YAML file.



Containers, when they start, run the command Entrypoint located in the dockerfile of the image.

Entrypoints are usually used to check the environment of the container and do the "initializing" work, like mounting a volume for example.

The Entrypoint represents the command to be run at the start of a container and CMD represents the arguments to be passed to the Entrypoint command.

Below is an example of a Dockerfile:


The above lines of the Dockerfile contain the default arguments for the Entrypoint, "arg2" and "arg3".

The default value for the Entrypoint, if no value is specified is "/bin/sh  -c".

If the Dockerfile of the image only specifies the CMD arguments, we could add the Entrypoint in the YAML file of the deployment in the containers section in the "command" parameter as below:


Comments

Leave as a comment:

Archive