I've used Jenkins a lot at work and was curious if I could do it on my home Linux machine. I followed the instructions for setting up Docker on the Jenkins site and was amazed that it was so easy to set up. Persistent files are securely stored in /var/lib/docker/volumes/jenkins-data
so the container can be restarted or rebuilt and settings, jobs, etc are maintained.
I guess I'm not a super sophisicated Docker guy but the way the Jenkins instructions had me set up the container (docker run ... --restart=on-failure ...
), it will restart automatically!
Check this out:
- I had the container running for a couple of weeks
- I was replacing the baking element in my oven at home, was fumbling with the circuit breakers (long story) and switched off the power for the Linux machine too. I didn't have it off for long but when I returned to the computer, it was at the login screen so the Linux machine automatically booted
- I also restored tabs in Chrome, noticed I still had a tab for my Jenkins server, and clicked it without thinking - but I began to think, wait, I just rebooted, the server isn't up. I need to restart the container
- I was amazed that the container was restarted! I didn't even have to log back into Jenkins in Chrome! Great!
There are just two files in this repo, maybe my most simple repository.
File | Purpose |
---|---|
Dockerfile |
The file used by docker build - I think this is basically verbatim from the Jenkins site. |
start.sh |
Starts the smash:
I cooked this script up on my own based on instructions from the Jenkins site and my own ideas. |