Skip to content

Instantly share code, notes, and snippets.

@dkowis
Created March 20, 2014 19:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dkowis/9672498 to your computer and use it in GitHub Desktop.
Save dkowis/9672498 to your computer and use it in GitHub Desktop.
Dockerfile for jenkins JNLP slave
# base image
FROM centos
# slavename variable
ENV SLAVENAME derpSlave
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 http://www.carfab.com/apachesoftware/maven/maven-3/3.2.1/binaries/apache-maven-3.2.1-bin.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