且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

Jenkins中的预配置环境变量

更新时间:2022-03-23 10:19:29

此处提供了可用的环境变量列表:

A list of available environment variables is available here: https://hub.docker.com/_/jenkins/

更新

如果要添加自己的环境变量,则需要构建自己的jenkins映像.您可以通过扩展现有图像或修改jenkins在 GitHub 上提供的官方docker构建项目来实现.

If you want to add your own environment variables you need to build your own jenkins image. You can do this by extending an existing image or modify the official docker build project provided by jenkins on GitHub.

Docker在此处上有一个很好的教程,介绍如何构建图像.

Docker has a nice tutorial on how to build images here.

在这种特定情况下,您需要修改docker入口点文件以在需要的地方检索和替换环境变量.对于jenkins,泊坞窗入口点文件位于/usr/local/bin/jenkins.sh.

In this specific case you need to modify the docker entrypoint file to retrieve and replace the environment variables where needed. For jenkins, the docker entrypoint file is located in /usr/local/bin/jenkins.sh.