Change entrypoint of a k8s Pod, but keep the CMD

6/9/2021

How to change the Docker ENTRYPOINT in a Kubernetes deployment, without changing also the Docker CMD?

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.

-- Kamafeather
command
docker
docker-entrypoint
dockerfile
kubernetes

1 Answer

6/9/2021

That's not a thing. ENTRYPOINT in Dockerfile == command: in PodSpec, and CMD == args:. So just override command but not args.

-- coderanger
Source: StackOverflow