Closed arezk84 closed 3 years ago
In this example, command
and args
can be used interchangeably.
The situation where command
can yield different results is when the Docker image uses ENTRYPOINT
. And using command
will overwrite the ENTRYPOINT
as stated in the docs:-
kubectl explain pod.spec.containers.command
... The docker image's ENTRYPOINT is used if this is not provided.
In this article, you may find some info on the topic. Also, the author wrote a gist demonstrating the difference between CMD
and ENTRYPOINT
in Docker, which relates to this topic as well.
In multi-container pod example: https://github.com/dgkanatsios/CKAD-exercises/blob/master/b.multi_container_pods.md
Why don't we use
command
in the init container instead ofargs
?As k8s docs: