forked from jenkins-docs/simple-java-maven-app
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
31 lines (22 loc) · 1019 Bytes
/
Dockerfile
File metadata and controls
31 lines (22 loc) · 1019 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
# Use Jenkins base image
FROM jenkins/jenkins:lts
USER root
ARG MAVEN_VER=3.8.6
# install wget and tools
RUN apt-get update && apt-get install -y wget && apt-get install -y software-properties-common
## INSTALL MAVEN ON JENKINS PROCESS
# get maven ${MAVEN_VER}
RUN wget --no-verbose -O /tmp/apache-maven-${MAVEN_VER}-bin.tar.gz https://repo.huaweicloud.com/apache/maven/maven-3/${MAVEN_VER}/binaries/apache-maven-${MAVEN_VER}-bin.tar.gz
# install maven
RUN tar xzf /tmp/apache-maven-${MAVEN_VER}-bin.tar.gz -C /opt/
RUN ln -s /opt/apache-maven-${MAVEN_VER} /opt/maven
RUN ln -s /opt/maven/bin/mvn /usr/local/bin
RUN rm -f /tmp/apache-maven-${MAVEN_VER}-bin.tar.gz
RUN chown -R jenkins:jenkins /opt/maven
## SET JAVA 8
RUN apt-add-repository 'deb http://security.debian.org/debian-security stretch/updates main'
RUN apt-get update && apt-get install -y openjdk-8-jdk
RUN update-alternatives --set java /usr/lib/jvm/java-8-openjdk-amd64/jre/bin/java
# remove download archive files
RUN apt-get clean
user jenkins