-
Notifications
You must be signed in to change notification settings - Fork 5
/
agent.Dockerfile
98 lines (94 loc) · 3.82 KB
/
agent.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
FROM jenkins/jnlp-slave:3.19-1
ENV \
### JDK
JAVA_VERSION_MAJOR=8 \
JAVA_VERSION_MINOR=131 \
JAVA_VERSION_BUILD=11 \
JAVA_PACKAGE=jdk \
JAVA_DOWNLOAD_HASH=d54c1d3a095b4ff2b6607d096fa80163 \
JAVA_HOME=/opt/jdk \
### Maven
MAVEN_HOME=/opt/maven \
MAVEN_VERSION=3.3.9 \
MAVEN_DEFAULT_OPTS=-Xmx512m \
MVN_OPTS=${MVN_OPTS:-${MAVEN_DEFAULT_OPTS}} \
APACHE_MIRROR_BASE_URL=http://ftp.halifax.rwth-aachen.de/apache \
MAVEN_MD5_CHECKSUM=516923b3955b6035ba6b0a5b031fbd8b \
MAVEN_DL_TMP_FILE=/tmp/apache-maven.tar.gz \
### GCloud SDK
GCLOUD_HOME=/opt/google-cloud-sdk \
CLOUDSDK_PYTHON_SITEPACKAGES=1 \
GCLOUD_COMPONENTS="kubectl alpha beta gcd-emulator cloud-datastore-emulator bigtable" \
DEBIAN_FRONTEND=noninteractive \
### Scala
SCALA_VERSION=2.11.12 \
SBT_VERSION=1.1.6 \
### Defaults
PATH=${PATH}:${JAVA_HOME}/bin:${MAVEN_HOME}/bin:${GCLOUD_HOME}/bin
USER root
RUN set -ex; \
### Add docker group with id 412 and add jenkins user to it
groupadd docker; groupmod -g 412 docker; usermod -aG docker jenkins; \
### Install JDK
curl -jksSLH "Cookie: oraclelicense=accept-securebackup-cookie" \
http://download.oracle.com/otn-pub/java/jdk/${JAVA_VERSION_MAJOR}u${JAVA_VERSION_MINOR}-b${JAVA_VERSION_BUILD}/${JAVA_DOWNLOAD_HASH}/${JAVA_PACKAGE}-${JAVA_VERSION_MAJOR}u${JAVA_VERSION_MINOR}-linux-x64.tar.gz \
| tar -xzf - -C /opt; \
\
ln -s /opt/${JAVA_PACKAGE}1.${JAVA_VERSION_MAJOR}.0_${JAVA_VERSION_MINOR} /opt/jdk; \
\
rm -rf /opt/jdk/*src.zip \
/opt/jdk/lib/missioncontrol \
/opt/jdk/lib/visualvm \
/opt/jdk/lib/*javafx* \
/opt/jdk/db \
/opt/jdk/jre/lib/plugin.jar \
/opt/jdk/jre/lib/ext/jfxrt.jar \
/opt/jdk/jre/bin/javaws \
/opt/jdk/jre/lib/javaws.jar \
/opt/jdk/jre/lib/desktop \
/opt/jdk/jre/plugin \
/opt/jdk/jre/lib/deploy* \
/opt/jdk/jre/lib/*javafx* \
/opt/jdk/jre/lib/*jfx* \
/opt/jdk/jre/lib/amd64/libdecora_sse.so \
/opt/jdk/jre/lib/amd64/libprism_*.so \
/opt/jdk/jre/lib/amd64/libfxplugins.so \
/opt/jdk/jre/lib/amd64/libglass.so \
/opt/jdk/jre/lib/amd64/libgstreamer-lite.so \
/opt/jdk/jre/lib/amd64/libjavafx*.so \
/opt/jdk/jre/lib/amd64/libjfx*.so; \
\
### Install maven
mkdir -p ${MAVEN_HOME}; \
curl -fsSL -o ${MAVEN_DL_TMP_FILE} ${APACHE_MIRROR_BASE_URL}/maven/maven-3/${MAVEN_VERSION}/binaries/apache-maven-$MAVEN_VERSION-bin.tar.gz; \
echo "${MAVEN_MD5_CHECKSUM} ${MAVEN_DL_TMP_FILE}" | md5sum -c -; \
tar -xzf ${MAVEN_DL_TMP_FILE} -C ${MAVEN_HOME} --strip-components=1; \
rm -f ${MAVEN_DL_TMP_FILE}; \
ln -s ${MAVEN_HOME}/bin/mvn /bin/mvn; \
\
### Install Scala
curl -SLs "http://www.scala-lang.org/files/archive/scala-${SCALA_VERSION}.deb" -o scala.deb; \
dpkg -i scala.deb; \
rm scala.deb; \
\
### Install Sbt
curl -SLs "https://dl.bintray.com/sbt/debian/sbt-${SBT_VERSION}.deb" -o sbt.deb; \
dpkg -i sbt.deb; \
rm sbt.deb; \
### Additional packages
apt-get update; \
apt-get install -y -qq --no-install-recommends zip unzip python python-dev python-pip build-essential openssh-client python-openssl jq net-tools sbt; \
apt-get clean; \
sbt sbtVersion; \
ln -s /usr/bin/sbt /bin/sbt; \
### Install google cloud SDK
cd /opt; \
curl -SLs https://dl.google.com/dl/cloudsdk/channels/rapid/google-cloud-sdk.zip -o google-cloud-sdk.zip; \
unzip google-cloud-sdk.zip; \
rm google-cloud-sdk.zip; \
google-cloud-sdk/install.sh --usage-reporting=false --rc-path=/.bashrc --additional-components ${GCLOUD_COMPONENTS}; \
pip install --upgrade google-api-python-client google-auth-httplib2 google-cloud; \
ln -s ${GCLOUD_HOME}/bin/gcloud /bin/gcloud;
COPY java-security/* /opt/jdk/lib/security/
COPY maven/settings.xml ${MAVEN_HOME}/conf/
USER jenkins