When a docker container crashes and I make a new one, how can I ensure I have the settings from the last one in place? The container I am running contains Jenkins only.
Asked
Active
Viewed 329 times
-1
-
See if this is what you are looking for ? https://engineering.riotgames.com/news/docker-jenkins-data-persists – Tarun Lalwani Sep 14 '17 at 12:51
-
Possible dup: https://stackoverflow.com/q/19585028/1531971 – Sep 14 '17 at 15:09
1 Answers
0
You need to use a volume if you want your configuration changes to be persisted.
In the image I am using as a base (usually jenkins/jenkins:2.75-alpine
), the configuration lives under: /var/jenkins_home/workspace
so all I need to do is something like:
docker run -v /path/on/host:/var/jenkins_home jenkins/jenkins:2.75-alpine

iocanel
- 570
- 2
- 2