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
Hence, if you want the changes to persist, you can use the Docker commit command. The commit command will save any changes you make to the container and create a new image layer on top of it.
Manage Jenkins → Manage Plugins In Jenkins you have to add a new credential with your Docker Hub account details. Go to Credentials → Global → Add credentials and fill out the form with your username and password.
That's why its ideal to have to changes in docker file and in short, there is no save state feature in docker system like we have in virtual machines. The memory contents are always lost. Save this answer.
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With