forked from jenkinsci/blueocean-plugin
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile.build
79 lines (67 loc) · 2.47 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
FROM ubuntu:16.04
ENV MAVEN_VERSION 3.3.3
ENV NODE_VERSION 6.4.0
ENV PHANTOMJS_VERSION 2.1.1
ARG UID=1000
ARG GID=1000
USER root
RUN apt-get update
#========================
# Miscellaneous packages
#========================
RUN apt-get update -qqy \
&& apt-get -qqy --no-install-recommends install \
sudo \
openjdk-8-jdk \
tar \
zip xz-utils \
curl wget \
git \
build-essential \
python \
iputils-ping \
&& rm -rf /var/lib/apt/lists/* \
&& sed -i 's/securerandom\.source=file:\/dev\/random/securerandom\.source=file:\/dev\/urandom/' ./usr/lib/jvm/java-8-openjdk-amd64/jre/lib/security/java.security
#==========
# Maven
#==========
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
#===============
# 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
# Update to latest version so optional dependancies + shrinkwrap work
RUN npm install -g [email protected]
#=============================================
# Misc packages needed by the ATH
#=============================================
RUN apt-get update -qqy \
&& apt-get -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-2.1.1-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]