-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
111 lines (92 loc) · 3.57 KB
/
Dockerfile
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
FROM adoptopenjdk:11.0.6_10-jdk-hotspot-bionic
LABEL maintainer="William Riley <[email protected]>"
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
#################################################
# Based on
# https://github.com/cloudbees/java-build-tools-dockerfile/blob/master/Dockerfile
#################################################
#================================================
# Customize sources for apt-get
#================================================
RUN DISTRIB_CODENAME=$(cat /etc/*release* | grep DISTRIB_CODENAME | cut -f2 -d'=') \
&& echo "deb http://archive.ubuntu.com/ubuntu ${DISTRIB_CODENAME} main universe\n" > /etc/apt/sources.list \
&& echo "deb http://archive.ubuntu.com/ubuntu ${DISTRIB_CODENAME}-updates main universe\n" >> /etc/apt/sources.list \
&& echo "deb http://security.ubuntu.com/ubuntu ${DISTRIB_CODENAME}-security main universe\n" >> /etc/apt/sources.list
RUN apt-get update -qqy \
&& apt-get -qqy --no-install-recommends install software-properties-common \
&& add-apt-repository -y ppa:git-core/ppa
#========================
# Miscellaneous packages
# iproute which is surprisingly not available in ubuntu:15.04 but is available in ubuntu:latest
# p7zip is for compressing to .7z
# tree is convenient for troubleshooting builds
#========================
RUN apt-get update -qqy \
&& apt-get -qqy --no-install-recommends install \
iproute2 \
openssh-client ssh-askpass\
ca-certificates \
tar zip unzip p7zip \
wget curl \
git git-lfs\
build-essential \
less nano tree \
jq \
python python-pip \
rsync \
gpg-agent \
libgtk-3-0 \
locales \
&& rm -rf /var/lib/apt/lists/*
RUN locale-gen en_US.UTF-8
# Need locale to be UTF-8
ENV LANG en_US.UTF-8
ENV LANGUAGE en_US:en
ENV LC_ALL en_US.UTF-8
# Make sure pip up to date
RUN pip install --upgrade pip setuptools
#==========
# Maven
#==========
ENV MAVEN_VERSION 3.6.3
RUN curl -fsSL http://archive.apache.org/dist/maven/maven-3/$MAVEN_VERSION/binaries/apache-maven-$MAVEN_VERSION-bin.tar.gz | tar xzf - -C /usr/share \
&& mv /usr/share/apache-maven-$MAVEN_VERSION /usr/share/maven \
&& ln -s /usr/share/maven/bin/mvn /usr/bin/mvn
ENV MAVEN_HOME /usr/share/maven
#==========
# Ant
#==========
ENV ANT_VERSION 1.10.7
RUN curl -fsSL https://www.apache.org/dist/ant/binaries/apache-ant-$ANT_VERSION-bin.tar.gz | tar xzf - -C /usr/share \
&& mv /usr/share/apache-ant-$ANT_VERSION /usr/share/ant \
&& ln -s /usr/share/ant/bin/ant /usr/bin/ant
ENV ANT_HOME /usr/share/ant
#=====
# XVFB
#=====
RUN apt-get update -qqy \
&& apt-get -qqy --no-install-recommends install \
xvfb \
&& rm -rf /var/lib/apt/lists/*
#========================================
# Add normal user for Jenkins
#========================================
RUN useradd jenkins --shell /bin/bash --create-home
USER jenkins
# for dev purpose
# USER root