Why jobs and system config were lost when run an image commited from a running jenkins container?

I started a jenkins container from the official jenkins image and added some plugins like git. Also, I made some basic configurations like authentication settings and user registration, then I added a jenkins job and it worked quite well in the running jenkins container.
Question is when I commited this jenkins container as a new version of jenkins image and re-ran the new image, everything was lost: no plugins added, no user registered, no jenkins job created.
Does anyone can help me to make a new jenkins image with all my configurations added? Thank you all.


  • Debug PHP cli application inside docker with PhpStorm
  • Specifying a hostheader binding in docker
  • Docker : How to change the location of directory images in Docker?
  • Docker compose scaling down and Consul
  • Wrong type error on an interface intended to test a method using Docker's client API
  • kubernetes volume for node_modules
  • Giving php-fpm user 'www-data' permission to write to directories owned by Docker root in container
  • How to connect SSMS to Linux SqlServer in docker container?
  • Two WordPress Containers on Kitematic
  • Configure docker images as executable
  • Pycharm 2017 docker support for debugging
  • Unable to install Docker for Windows for the Divio App
  • 2 Solutions collect form web for “Why jobs and system config were lost when run an image commited from a running jenkins container?”

    you have to backup your data before rerun jenkins image:

    docker cp jenkins-dv:/var/jenkins_home /tmp/jenkins-backup

    also you can check this very helpful tutoriel DOCKER & JENKINS: DATA THAT PERSISTS explain HOST MOUNTED VOLUMES and DATA VOLUME CONTAINERS

    Dockerfile of Jenkins defines a volume for its home directory:

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

    Per default Docker manages this volume on a per container base. If you would like to use same data as in your old image/container version you have mainly two options:

    Give volume a name at run

    docker run -v jenkinshome:/var/jenkins_home jenkins

    or map it to a volume on host system:

    docker run -v /some/dir/jenkinshome:/var/jenkins_home jenkins

    This way data will persist image upgrades. You can read more about managing data at official Docker documentation.

    Docker will be the best open platform for developers and sysadmins to build, ship, and run distributed applications.