提交给jenkins docker镜像不会保存更改 [英] Commit to jenkins docker image does not save changes

查看:255
本文介绍了提交给jenkins docker镜像不会保存更改的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我从此处提取了官方的Jenkins码头工人图像。
从Jenkins UI中创建一个新作业,安装github插件并在作业配置中设置存储库网址。

I pull the official Jenkins docker image from here. From Jenkins UI I create a new job , install the github plugin and set the repo urls in the job configuration.

最后,我保存了Jenkins的更改。

Finally I save the changes from Jenkins.

我想按原样创建一个新图像。我停止容器,并将其提交到新映像。

I want to create a new image as it is. I stop the container, and commit it to a new image.

然后我从新映像启动新容器... Jenkins不包含我的任何更改。

Then I start a new container from the new image...and Jenkins does not contain any of my changes.

我使用 Docker版本1.6.2,构建7c8fca2

推荐答案

Dockerfile 将jenkins主目录声明为

The Dockerfile declares the jenkins home directory as a volume

# Jenkins home directoy is a volume, so configuration and build history 
# can be persisted and survive image upgrades
VOLUME /var/jenkins_home

这意味着对Jenkins配置的所有更改都是在docker映像之外进行的。

This means all changes to the Jenkins configuration is made outside of the docker image.

自述项目描述了如何使用预安装的插件创建自己的派生docker映像。

The project README describes how to create your own derivative docker images with plugins pre-installed.

  • https://github.com/jenkinsci/docker/blob/master/README.md

例如

FROM jenkins
COPY plugins.txt /usr/share/jenkins/plugins.txt
RUN /usr/local/bin/plugins.sh /usr/share/jenkins/plugins.txt

这篇关于提交给jenkins docker镜像不会保存更改的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆