Public Repository

Last pushed: 2 years ago
Short Description
Jenkins Image for G4S
Full Description

FROM ubuntu:trusty

Add Jenkins user and set password

RUN useradd -d "/home/jenkins" -u 1000 -m jenkins
RUN echo "jenkins:jenkins" | chpasswd
RUN adduser jenkins sudo

Install

RUN apt-get update
RUN apt-get install -y wget git curl zip nodejs maven npm software-properties-common && rm -rf /var/lib/apt/lists/*

set shell variables for java installation

ENV java_version 1.7.0_79
ENV filename jdk-7u79-linux-x64.tar.gz
ENV downloadlink http://download.oracle.com/otn-pub/java/jdk/7u79-b15/$filename

download java, accepting the license agreement

RUN wget --no-cookies --header "Cookie: oraclelicense=accept-securebackup-cookie" -O /tmp/$filename $downloadlink

unpack java

RUN mkdir /opt/java-oracle
RUN tar -zxvf /tmp/$filename -C /opt/java-oracle/
ENV JAVA_HOME /opt/java-oracle/jdk1.7.0_79
ENV PATH $JAVA_HOME/bin:$PATH

configure symbolic links for the java and javac executables

RUN update-alternatives --install /usr/bin/java java $JAVA_HOME/bin/java 20000 && update-alternatives --install /usr/bin/javac javac $JAVA_HOME/bin/javac 20000

Install Jenkins

RUN wget -q -O - https://jenkins-ci.org/debian/jenkins-ci.org.key | apt-key add -
RUN sh -c 'echo deb http://pkg.jenkins-ci.org/debian binary/ > /etc/apt/sources.list.d/jenkins.list'
RUN apt-get update
RUN apt-get -y install jenkins

USER jenkins

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

Docker Pull Command
Owner
ladybarretto

Comments (0)