由Dockerfile的入口处指令运行的Shell脚本可以访问Helm Chart设置的容器环境变量吗?

发布于 2025-02-09 18:14:46 字数 206 浏览 2 评论 0原文

我的容器是由Helm Charts构建和部署在AWS EKS K8S群集上的,这也设置了容器中的环境变量。

在用于构建图像的Dockerfile中,我想在最后一个(在容器开始时运行)在入门点指令中运行INIT SHELL脚本,以进行一些初始配置。

Shell脚本可以访问容器中的Helm图表设置的ENV变量,以便我可以在Shell脚本中具有特定于ENV的分支/条件吗?

My container is being built and deployed on the AWS EKS k8s cluster by helm charts, which also sets the environment variable in the container.

In the Dockerfile that is used to build the image, I want to run a init shell script in the ENTRYPOINT directive at the last (which is run at the start of the container) for some initial configurations.

Can the shell script have access to the env variable set by the helm charts in the container so that I can have env-specific branches/conditions in the shell script?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

那伤。 2025-02-16 18:14:46

是的,但请记住掌舵图(如在此处进行了说明),它将 Override <<代码>输入点您在Dockerfile中定义的用于构建图像。

除此之外,在运行时,entrypoint脚本将可以访问包装管理器(Helm)设置的环境,负责在您的图像上执行Docker Run

Yes, but keep in mind a Helm Chart (as illustrated here) which would override the ENTRYPOINT you defined in your Dockerfile for building your image.

Other than that, at runtime, the ENTRYPOINT script will have access to the environment setup by the package manager (Helm) in charge of executing a docker run on your image.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文