Ceci Ivanov:
- Kubectl run nginx --image=nginx --command – echo “hello”
- Kubectl run nginx --image=nginx – echo “hello”
I ran them with --dry-run=client -o yaml and saw that on the first one command there is spec in the containers
-command:
-echo
-hello
but on the 2nd one there is spec
-args:
-echo
-hello
Marko Eremija:
the first one is to run a command (override the one coming with Docker image), and the second one just adds arguments to the default command provided by the Docker image
Marko Eremija:
at least that’s how I read it
Ceci Ivanov:
ooh ok but what is the default command coming with docker image?
Bishop Mbong:
to see the default command, look at the dockerfile
Ceci Ivanov:
I suppose there shouldn’t be some specified default, yeah I thought about docker file but where I can find this docker file as I run just Kubectl and creating pod
Marko Eremija:
it’s usually under the ENTRYPOINT
Marko Eremija:
ok, Docker file, i.e., the image you are using to create the Pod
Marko Eremija:
you can use docker inspect <image_name>
and look for the ENTRYPOINT
Ceci Ivanov:
ok thank you
unnivkn:
Hi @Ceci Ivanov fyr: