Jenkins inside docker loses configuration when container is restarted -


i have followed next guide https://hub.docker.com/r/iliyan/jenkins-ci-php/ download docker image jenkins.

when start container using docker start containername command, can access jenkins localhost:8080.

the problem comes when change jenkins configuration , restart jenkins using docker stop containername , docker start containername, jenkins doesn't contain of previous configuration changes..

how can persist jenkins configuration?

you need mount jenkins configuration volume, -v flag you. (you can ignore --privileged flag in example unless plan on building docker images inside jenkins docker image)

docker run --privileged --name='jenkins' -d -p 6999:8080 -p 50000:50000 -v /home/jan/jenkins:/var/jenkins_home jenkins:latest 

the -v flag mount /var/jenkins_home outside container in /home/jan/jenkins maintaining between rebuilds.

--name have fixed name container start / stop from.

then next time want run it, call

docker start jenkins 

Comments

Popular posts from this blog

javascript - Laravel datatable invalid JSON response -

java - Exception in thread "main" org.springframework.context.ApplicationContextException: Unable to start embedded container; -

sql server 2008 - My Sql Code Get An Error Of Msg 245, Level 16, State 1, Line 1 Conversion failed when converting the varchar value '8:45 AM' to data type int -