Jenkins docker Image + prefix

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

Comments

arrow_back

Previous

BBQ Chicken Pizza

Next

Talk on Testing - Code and Coffee YVR
arrow_forward
Gavin December 1989

Gavin Mogan

Hi. I'm Gavin. I'm a coder at Sauce Labs. At home I code, game, hang out, all the cool non robot things to do. #notarobot

Friends Sites