How to change the Docker
ENTRYPOINT
in a Kubernetes deployment, without changing also the DockerCMD
?
In the Pod I would do
image: "alpine"
entrypoint: "/myentrypoint"
but this overwrites either ENTRYPOINT
and the CMD
from the Dockerfile
.
The documentation doesn't mention it, but seems like a big use-case missed.
ENTRYPOINT
anddocker run --entrypoint
also reset the command part. Do you have a more specific use case where you want to reset the entrypoint (Kubernetescommand:
) but keep the command (Kubernetesargs:
)? – MesseniaENTRYPOINT
is used whitdocker exec
, whileCMD
is the default withdocker run
when nothing is specified. I'm ok with the defaultrun
service (specified withCMD
),FROM
the image I am extending. But I want to customise itsENTRYPOINT
script to handle specificexec
commands. – Ixtlecommand
together withargs
, but I do not want to manually keep in sync with the base image (that I have no control on). It's inconvenient when having: BaseImageWithCMD -> MyBaseImage -> MyActualImage -> KubernetesWithCustomENTRYPOINT – Ixtledocker exec
orkubectl exec
. Again, a more specific use case might help suggest a different approach. – Messeniakubectl exec
on the container running in the pod. I want to perform additional checks (that the base image entrypoint does not), when executing a non-default command, – Ixtledocker exec
orkubectl exec
" - I was missing this detail and wrongly expected ENTRYPOINT to be called at every access to the container, as it happens withdocker run --rm -i ..
. I ended up adding it explicitly intokubectl exec deploy/mint -- /myentrypoint $@
. – Ixtle