Warm tip: This article is reproduced from serverfault.com, please click

Commit to jenkins docker image does not save changes

发布于 2015-10-30 19:53:19

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.

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.

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

I use Docker version 1.6.2, build 7c8fca2

Questioner
Kostas Demiris
Viewed
0
Mark O'Connor 2015-10-31 15:33:26

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

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

Update

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

For example

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