When you run jenkins behind a firewall you need it to get out. You’ll have to set up proxies to let this happen. Here’s how I make it run:
First, make coreos able to go out of your network:
1 2 3 |
sudo mkdir -p /etc/systemd/system/docker.service.d cd /etc/systemd/system/docker.service.d/ touch http-proxy.conf |
Next edit http-proxy.conf and make it look like:
1 2 |
[Service] Environment="HTTPS_PROXY=http://proxy.esl.cisco.com:80" |
This will allow docker to get outside the firewall.
Next restart docker:
1 2 |
systemctl daemon-reload systemctl restart docker |
Now, on to Jenkins. Grab Jenkins:
1 |
docker pull jenkins |
Make a persistent directory to store settings (should be a persistent volume mount)
1 2 |
sudo mkdir -p /vol/jenkins_home chmod 777 /vol/jenkins_home |
Now run the container with the following JAVA_OPTS flag as documented here.
1 2 3 4 5 6 |
#!/bin/bash docker run -v /vol/jenkins_home:/var/jenkins_home \ --name jenkins --name jenkins --name jenkins \ --env JAVA_OPTS="-Dhttp.proxyHost=proxy.esl.cisco.com -Dhttp.proxyPort=80 -Dhttps.proxyHost=proxy.esl.cisco.com -Dhttps.proxyPort=80" \ -p 8080:8080 -p 50000:50000 -d jenkins |
You’ll obviously want to use your proxy server instead of mine!
You should now be able to install all the plugins you need! Hurray!