docker-jenkins-slave
This is a very minimal docker image with the very minimum of tools. Because of this, all build tools should be installed via jenkins tool installers on master.
Usage
- Run
get-slave.sh
to download the jenkinsslave.jar
to the current directory. docker build -t jenkins-slave .
- OPTIONAL: Create a directory on the filesystem to keep the jenkins slave working directory in. This allows you to not redownload the JDK, gradle, maven etc. when the container reboots.
- Create the slave persist directory
chown -R 9001 <slave persist directory>
as root- Create a new dumb slave in the Jenkins web gui with the following options:
- Remote root directory:
/jenkins-slave/
- Launch method:
Launch slave agents via Java Web Start
- Copy
jnlpUrl
andsecret
fromRun from slave command line
docker create --name jenkins-slave -v <slave persist directory>:/jenkins-slave/ jenkins-slave -jnlpUrl <jnlpURL> -secret <secret>
docker run jenkins-slave