Public Repository

Last pushed: 2 months ago
Short Description
Jenkins slave with JDK 8,Git, Ant 1.10.1, Node 4.3 & Newman 3.7.2
Full Description

FROM ubuntu:14.04

Set Proxy

ENV https_proxy=""
ENV http_proxy=""

USER root

Set locale

ENV LC_ALL en_US.UTF-8
ENV LANG en_US.UTF-8
ENV LANGUAGE en_US.UTF-8

Set user jenkins to the image

RUN useradd -m -d /home/jenkins -s /bin/sh jenkins &&\
echo "jenkins:jenkins" | chpasswd

Standard SSH port

EXPOSE 22
EXPOSE 2222

Default command

CMD ["/usr/sbin/sshd", "-D"]

RUN apt-get update
RUN apt-get install -y wget

Install curl and npm

RUN apt-get update && apt-get install -y \
curl \
npm;

Set node version

ENV NODE_VERSION 4.3.0

Install node

RUN npm install -g n;
RUN n ${NODE_VERSION};

Set newman version

ENV NEWMAN_VERSION 3.7.2

Install newman

RUN npm install -g newman@${NEWMAN_VERSION};

RUN apt-get install -y git wget

Preparations for sshd

RUN locale-gen en_US.UTF-8 &&\
apt-get -q update &&\
DEBIAN_FRONTEND="noninteractive" apt-get -q upgrade -y -o Dpkg::Options::="--force-confnew" --no-install-recommends &&\
DEBIAN_FRONTEND="noninteractive" apt-get -q install -y -o Dpkg::Options::="--force-confnew" --no-install-recommends openssh-server &&\
apt-get -q autoremove &&\
apt-get -q clean -y && rm -rf /var/lib/apt/lists/ && rm -f /var/cache/apt/.bin &&\
sed -i 's|session required pam_loginuid.so|session optional pam_loginuid.so|g' /etc/pam.d/sshd &&\
mkdir -p /var/run/sshd

Oracle JDK

Set Java version

ENV JAVA_VERSION 8u131
ENV JAVA_BUILD 14
ENV JAVA_HOME /etc/jdk-${JAVA_VERSION}-b${JAVA_BUILD}

Install Java

RUN cd /tmp
RUN wget --no-check-certificate --no-cookies --header "Cookie: oraclelicense=accept-securebackup-cookie" http://download.oracle.com/otn-pub/java/jdk/${JAVA_VERSION}-b11/d54c1d3a095b4ff2b6607d096fa80163/jdk-${JAVA_VERSION}-linux-x64.tar.gz --no-check-certificate
RUN mkdir jdk-${JAVA_VERSION}-linux-x64
RUN tar -zxvf jdk-${JAVA_VERSION}-linux-x64.tar.gz --directory jdk-${JAVA_VERSION}-linux-x64 --strip-components=1
RUN mv jdk-${JAVA_VERSION}-linux-x64 ${JAVA_HOME}
ENV PATH ${PATH}:${JAVA_HOME}/bin
RUN ln -s ${JAVA_HOME}/bin/java /usr/bin/java
RUN chmod 777 /usr/bin/java

Cleanup installation files

RUN rm jdk-${JAVA_VERSION}-linux-x64.tar.gz
RUN unset JAVA_VERSION

Ant

Set Ant version

ENV ANT_VERSION 1.10.1
ENV ANT_HOME /etc/ant-${ANT_VERSION}

Install Ant

RUN cd /tmp
COPY apache-ant-1.10.1-bin.tar.gz apache-ant-1.10.1-bin.tar.gz
RUN ls -all
RUN chmod 777 apache-ant-1.10.1-bin.tar.gz
RUn pwd
RUN mkdir ant-${ANT_VERSION}
RUN ls -all
RUN tar -zxvf apache-ant-${ANT_VERSION}-bin.tar.gz --directory ant-${ANT_VERSION} --strip-components=1
RUN mv ant-${ANT_VERSION} ${ANT_HOME}
ENV PATH ${PATH}:${ANT_HOME}/bin
RUN wget -O /etc/ant-${ANT_VERSION}/lib/jsch-0.1.53.jar http://central.maven.org/maven2/com/jcraft/jsch/0.1.53/jsch-0.1.53.jar --no-check-certificate
RUN chmod -R 777 /etc/ant-${ANT_VERSION}/lib
RUN ln -s ${ANT_HOME}/bin/ant /usr/bin/ant
RUN chmod 777 /usr/bin/ant

Cleanup installation files

RUN rm apache-ant-${ANT_VERSION}-bin.tar.gz
RUN unset ANT_VERSION

Testing

RUN env
RUN java -version
RUN git --version
RUN ant -version
RUN npm -v
RUN node -v
RUN newman -v

Docker Pull Command
Owner
sathes