简体   繁体   English

更改 k8s Pod 的入口点,但保留 CMD

[英]Change entrypoint of a k8s Pod, but keep the CMD

How to change the Docker ENTRYPOINT in a Kubernetes deployment, without changing also the Docker CMD ?如何在 Kubernetes 部署中更改 Docker ENTRYPOINT ,而不更改 Docker CMD

In the Pod I would do在 Pod 我会做

image: "alpine"
entrypoint: "/myentrypoint"

but this overwrites either ENTRYPOINT and the CMD from the Dockerfile .但这会覆盖ENTRYPOINT CMD CMD Dockerfile

The documentation doesn't mention it, but seems like a big use-case missed. 文档没有提到它,但似乎错过了一个很大的用例。

That's not a thing.那不是一回事。 ENTRYPOINT in Dockerfile == command: in PodSpec, and CMD == args: . ENTRYPOINT == command:在 PodSpec 和CMD == args:中。 So just override command but not args .所以只需覆盖command而不是args

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM