forked from jenkinsci/blueocean-plugin
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile.build
94 lines (78 loc) · 2.74 KB
/
Dockerfile.build
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
FROM ubuntu:20.04
ENV MAVEN_VERSION 3.9.4
ENV NODE_VERSION 10.13.0
ENV PHANTOMJS_VERSION 2.1.1
ARG UID=1000
ARG GID=1000
ENV DEBIAN_FRONTEND=noninteractive
USER root
RUN apt-get update
#========================
# Miscellaneous packages
#========================
RUN apt update -qqy \
&& apt -qqy --no-install-recommends install \
sudo \
openjdk-11-jdk \
tar \
zip xz-utils \
curl wget \
git \
build-essential \
python \
iputils-ping \
net-tools \
locales \
libsass-dev \
&& rm -rf /var/lib/apt/lists/* \
&& sed -i 's/securerandom\.source=file:\/dev\/random/securerandom\.source=file:\/dev\/urandom/' /usr/lib/jvm/java-11-openjdk-amd64/conf/security/java.security
# Set utf-8 locale
RUN locale-gen en_US.UTF-8
ENV LANG en_US.UTF-8
ENV LC_ALL en_US.UTF-8
#==========
# Maven
#==========
RUN curl -fsSL https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/$MAVEN_VERSION/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
#===============
# Node and NPM
#===============
RUN wget --no-verbose https://nodejs.org/dist/v$NODE_VERSION/node-v$NODE_VERSION-linux-x64.tar.xz -O /opt/nodejs.tar.xz
RUN tar -C /usr/local --strip-components 1 -xJf /opt/nodejs.tar.xz
RUN mkdir /.npm && chmod 777 /.npm
#=============================================
# Misc packages needed by the ATH
#=============================================
RUN apt update -qqy \
&& apt install -y tzdata \
&& apt -qqy --no-install-recommends install \
libxml2-utils \
libssl-dev \
&& rm -rf /var/lib/apt/lists/*
#=============================================
# Phantom JS
#=============================================
RUN wget --no-verbose -O - -L https://bitbucket.org/ariya/phantomjs/downloads/phantomjs-$PHANTOMJS_VERSION-linux-x86_64.tar.bz2 \
| tar -xj --strip-components=1 -C /usr/local
#========================================
# Add normal user with passwordless sudo
#========================================
RUN sudo groupadd -r -g $GID bouser \
&& sudo useradd bouser -g $GID -u $UID --shell /bin/bash --create-home \
&& sudo usermod -a -G sudo bouser \
&& echo 'ALL ALL = (ALL) NOPASSWD: ALL' >> /etc/sudoers \
&& echo 'bouser:secret' | chpasswd
USER bouser
WORKDIR /home/bouser
#========================================
# Configure the local git user.
#========================================
RUN git config --global user.name "John Doe"
RUN git config --global user.email [email protected]
#========================================
# Need ssh
#========================================
RUN sudo apt-get update -qqy && sudo apt-get install -y ssh