简体   繁体   English

在 Docker 中安装 Jenkins 及其插件,然后保存新图像以在另一台离线 PC 中使用

[英]install Jenkins & its plugins in Docker,then save a new image to be used in the other offline PC

Installl Jenkins and its plugins in an offline pc is difficult.在离线电脑上安装 Jenkins 及其插件很困难。 can I install Jenkins in Docked, intall all the plugins needed in a PC, and then save this new image and copy it to the other PC which is offline?我可以在 Docked 中安装 Jenkins,在 PC 中安装所需的所有插件,然后保存这个新图像并将其复制到另一台离线的 PC 上吗?

One option is to mound local directory wit Jenkins and install plugins.一种选择是使用 Jenkins 堆积本地目录并安装插件。

docker run -it --rm -v $PWD/:/var/jenkins_home -p 8081:8080 jenkins/jenkins

Once you mount host directory, then install required plugging, create Dockerfile like below挂载主机目录后,安装所需的插件,创建 Dockerfile 如下所示

FROM jenkins/jenkins
COPY plugins /var/jenkins_home/plugins/

Then build this Dockerfile,然后构建这个 Dockerfile,

docker build -t my_custom_jenkins .

Then you can share this image with others and it will contain all plugins.然后您可以与其他人共享此图像,它将包含所有插件。

If you need full configuration then use below option如果您需要完整配置,请使用以下选项

FROM jenkins/jenkins
COPY . /var/jenkins_home/plugins/

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

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