This docker jenkins slaves images to be used with the awesome jenkins docker plugin.
They are available in the philpep/jenkins-slave repository.
All the images run a openssh server, the jenkins
master can connect with the jenkins
user (the password is jenkins
). This
user can run any command as root using sudo.
The jenkins user is also a postgresql superuser. A basic build script for jenkins can be:
sudo service postgresql start
createdb test
DBNAME=test ./runtests.sh
WARNING: Neither docker and the image is safe against malicious code, so consider that any developer who can push code and trigger a build can take control of your jenkins server. If you don't trust the developer, carefully review the code before trigger a build.
Installation:
docker pull philpep/jenkins-slave:jessie
This is a debian jessie including:
- gcc 4.9
- Python 2.7.9 and 3.4.2
- PostgreSQL 9.4
- redis 2.8
- pip 7.1
- virtualenv 13.1
- tox 2.1
- docker 1.8
- vagrant 1.7
As you can see, this image can run docker in docker :)
This is convenient if your test/build process include docker or vagrant (or both).
You will have to run container privileged (an option configure in jenkins Docker Template) and start docker within the build script.
sudo wrapdocker true
[...]
You are advised to use a docker registry mirror to save bandwidth while pulling images.
sudo DOCKER_DAEMON_ARGS="--registry-mirror=http://mirror:5000" wrapdocker true
[...]
For optimal performance, if you have a slow disks but a lot of RAM, you can run docker on tmpfs:
sudo mount -t tmpfs -o size=3G tmpfs /var/lib/docker
sudo wrapdocker true
[...]
Installation:
docker pull philpep/jenkins-slave:wheezy
This is a debian jessie including:
- gcc 4.7
- Python 2.7.3
- PostgreSQL 9.4
- redis 2.4
- pip 7.1
- virtualenv 13.1
- tox 2.1
Same as philpep/jenkins-slave:wheezy
but in i386 architecture.