Jenkins docker Image + prefix
Published on Apr 18, 2016, 12:06 PM1 min read
I'm probably going to need this again sometime.
Upstart
# cat /etc/init/jenkins.conf
description "Jenkins"
author "Gavin Mogan"
start on filesystem and started docker
stop on runlevel [!2345]
respawn
script
/usr/bin/docker stop jenkins || true
/usr/bin/docker rm jenkins || true
/usr/bin/docker run --rm --name="jenkins" -p 8080:8080 -p 50000:50000 -v /var/lib/jenkins:/var/jenkins_home jenkinsci/jenkins:2.0-rc-1 --prefix=/jenkins
end script
Systemd
$ cat /etc/systemd/system/jenkins-docker.service
[Unit]
Description=Jenkins
After=docker.service
Requires=docker.service
[Service]
TimeoutStartSec=0
Restart=always
ExecStartPre=-/usr/bin/docker stop jenkins
ExecStartPre=-/usr/bin/docker rm jenkins
ExecStart=/usr/bin/docker run --name="jenkins" -p 8080:8080 -p 50000:50000 -v /home/jenkins:/var/jenkins_home jenkinsci/jenkins:2.0-rc-1 --prefix=/jenkins
[Install]
WantedBy=multi-user.target

Gavin Mogan
I'm Gavin.
I'm a tinker, maker, and software developer.
At home I code, game, hang out, all the cool non robot things to do.
Heavily involved with Jenkins open source, and will often submit PRs to random other projects.
I also play games, both board and video games and love to read.
You can usually find me on various services as halkeye.
#notarobot
Comments