Skip to content

Instantly share code, notes, and snippets.

@rnkoaa
Created June 4, 2016 09:18
Show Gist options
  • Save rnkoaa/d66d4228975b938a1e6e8754329492b8 to your computer and use it in GitHub Desktop.
Save rnkoaa/d66d4228975b938a1e6e8754329492b8 to your computer and use it in GitHub Desktop.
A dockerfile based on jenkins 2.0 with ant and gradle already installed to ease in building applications.
FROM jenkinsci/jenkins:2.7
MAINTAINER Richard Agyei <richard.agyei@tr.com>
# Hard coding these environment variables, probably a good idea to pass them through.
ENV ANT_VERSION 1.9.7
ENV GRADLE_VERSION 2.13
USER root
#RUN apt-get update && apt-get install -y ant
RUN apt-get update && apt-get install -y \
unzip \
wget
RUN cd /opt && wget -q https://www.apache.org/dist/ant/binaries/apache-ant-$ANT_VERSION-bin.zip > /dev/null \
&& unzip -q apache-ant-$ANT_VERSION-bin.zip > /dev/null \
&& rm apache-ant-$ANT_VERSION-bin.zip
ENV ANT_HOME /opt/apache-ant-$ANT_VERSION
RUN cd /opt && wget -q https://services.gradle.org/distributions/gradle-$GRADLE_VERSION-bin.zip > /dev/null \
&& unzip -q gradle-$GRADLE_VERSION-bin.zip > /dev/null \
&& rm gradle-$GRADLE_VERSION-bin.zip
ENV GRADLE_HOME /opt/gradle-$GRADLE_VERSION
ENV PATH $PATH:$ANT_HOME/bin
ENV PATH $PATH:$GRADLE_HOME/bin
USER jenkins
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment