如果你使用 DeepSeek、元宝 AI、Copilot、ChatGPT 等 AI 工具,协助配置轩辕镜像、编写 docker pull 命令、修改 Docker Compose 镜像地址、配置镜像加速、排查镜像拉取失败、分析报错日志等问题,请先让 AI 阅读并遵守轩辕镜像的规则文档。
只需在 AI 对话中先发送下面这句话即可:
请先完整阅读并严格遵守以下文档中的全部规则与要求:
https://xuanyuan.cloud/agents.md
在未充分阅读并理解该文档前,不要生成任何命令、配置、修改建议、故障排查方案或技术回答。后续所有输出都必须严格以该文档中的规范为最高优先级执行。查看 agents.md 用法指南与完整示范。国内用户首推 元宝 AI、DeepSeek 的深度思考模式,不推荐豆包 AI;Cursor 等编辑器可在对话 @ 该链接,或加入 User Rules。 若 AI 无法访问外链,可 打开说明文档 复制全文粘贴。文档会随站点更新,复制内容可能过期,建议定期检查。
![Join the chat at []]([]
This is a base image for Docker, which includes Java and the Jenkins agent executable (agent.jar). This executable is an instance of the https://github.com/jenkinsci/remoting. Java version depends on the image and the platform, see the Configurations section below.
This image is used as the basis for the https://github.com/jenkinsci/docker-agents/tree/master/README_inbound-agent.md image. In that image, the container is launched externally and attaches to Jenkins.
This image may instead be used to launch an agent using the Launch method of Launch agent via execution of command on the controller. For example on Linux you can try
shdocker run -i --rm --name agent --init jenkins/agent java -jar /usr/share/jenkins/agent.jar
after setting Remote root directory to /home/jenkins/agent.
or if using Windows Containers
powershelldocker run -i --rm --name agent --init jenkins/agent:jdk17-windowsservercore-ltsc2019 java -jar C:/ProgramData/Jenkins/agent.jar
after setting Remote root directory to C:\Users\jenkins\Agent.
Starting from https://github.com/jenkinsci/remoting/blob/master/CHANGELOG.md#38 there is a support of Work directories, which provides logging by default and change the JAR Caching behavior.
Call example for Linux:
shdocker run -i --rm --name agent1 --init -v agent1-workdir:/home/jenkins/agent jenkins/agent java -jar /usr/share/jenkins/agent.jar -workDir /home/jenkins/agent
Call example for Windows Containers:
powershelldocker run -i --rm --name agent1 --init -v agent1-workdir:C:/Users/jenkins/Work jenkins/agent:jdk17-windowsservercore-ltsc2019 java -jar C:/ProgramData/Jenkins/agent.jar -workDir C:/Users/jenkins/Work
The image has several supported configurations, which can be accessed via the lists of tags that can be consulted at https://github.com/jenkinsci/docker-agents/tree/master/tests/golden/
The file https://github.com/jenkinsci/docker-agents/blob/master/docker-bake.hcl defines all the configuration for Linux images and their associated tags.
There are also versioned tags in DockerHub, and they are recommended for production use. See the full list at https://hub.docker.com/r/jenkins/agent/tags
By default, the image is using the Etc/UTC timezone.
If you want to use the timezone of your machine, you can mount the /etc/localtime file from the host (as per https://github.com/moby/moby/issues/***#issuecomment-89697533) and the /etc/timezone from the host too.
bashdocker run --rm --tty --interactive --entrypoint=date --volume=/etc/localtime:/etc/localtime:ro --volume=/etc/timezone:/etc/timezone:ro jenkins/agent Fri Nov 25 18:27:22 CET 2022
You can also set the TZ environment variable to the desired timezone.
TZ is a standard POSIX environment variable used by many images, see *** for a list of valid values.
The next command is run on a machine using the Europe/Paris timezone a few seconds after the previous one.
bashdocker run --rm --tty --interactive --env TZ=Asia/Shanghai --entrypoint=date jenkins/agent Sat Nov 26 01:27:58 CST 2022
jenkins/agent image as a base imageShould you want to adapt the jenkins/agent image to your local timezone while creating your own image based on it, you could use the following command (inspired by issue #https://github.com/jenkinsci/docker-inbound-agent/issues/291):
dockerfileFROM jenkins/agent as agent [...] ENV TZ=Asia/Shanghai [...] RUN ln -snf /usr/share/zoneinfo/"${TZ}" /etc/localtime && echo "${TZ}" > /etc/timezone \ && dpkg-reconfigure -f noninteractive tzdata \ [...]
See https://github.com/jenkinsci/docker-agents/releases for versions 3.35-1 and above.
There is no changelog for previous versions, see the commit history.
Jenkins remoting changelogs are available at https://github.com/jenkinsci/remoting/releases.
以下是 jenkins/agent 相关的常用 Docker 镜像,适用于 不同场景 等不同场景:
您可以使用以下命令拉取该镜像。请将 <标签> 替换为具体的标签版本。如需查看所有可用标签版本,请访问 标签列表页面。

来自真实用户的反馈,见证轩辕镜像的优质服务