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
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.
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
Right...so I must create my own image based on the official one. Thanks
I was wondering...if I removed the VOLUME directive from the official Jenkins dockerfile , and made my changes in a new container, then I could commit it as a new image that would contain the changes...right?
Confirmed.I did it like this and now I have a Jenkins image containing a custom job and the github plugin by default.
@KostasDemiris Awesome. Was just looking for that !