Skip to content

Instantly share code, notes, and snippets.

Created Mar 20, 2014
What would you like to do?
Dockerfile for jenkins JNLP slave
# base image
FROM centos
# slavename variable
RUN yum -y install java-1.7.0-openjdk-devel java-1.7.0-openjdk git rpm-build
RUN adduser -d /opt/jenkins jenkins
# install maven
RUN mkdir /opt/maven
RUN wget -O /opt/maven-3.2.1.tar.gz
RUN cd /opt && tar -zxf maven-3.2.1.tar.gz
RUN rm -rf /opt/maven && mv /opt/apache-maven-3.2.1 /opt/maven
# Get the slave jnlp
RUN wget -O /opt/jenkins/slave.jar http://jenkinsServer/jnlpJars/slave.jar
#start up teh slaev!
CMD su - jenkins -c "java -jar /opt/jenkins/slave.jar -slaveLog /opt/jenkins/slaveLog -jnlpUrl http://jenkinsServer/computer/$SLAVENAME/slave-agent.jnlp"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment