forked from odota/core
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
120 lines (107 loc) · 4.94 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
112
113
114
115
116
117
118
119
120
FROM mhart/alpine-node:5.10.1
# Tools
RUN apk update && apk add git curl wget bash
# Java
# as of 2016-06-12, running on alpine openjdk causes a unsatisfiedlinkerror crash in Java
#RUN apk update && apk add openjdk8=8.92.14-r1
# Here we install GNU libc (aka glibc) and set C.UTF-8 locale as default.
RUN ALPINE_GLIBC_BASE_URL="https://github.com/sgerrand/alpine-pkg-glibc/releases/download" && \
ALPINE_GLIBC_PACKAGE_VERSION="2.23-r2" && \
ALPINE_GLIBC_BASE_PACKAGE_FILENAME="glibc-$ALPINE_GLIBC_PACKAGE_VERSION.apk" && \
ALPINE_GLIBC_BIN_PACKAGE_FILENAME="glibc-bin-$ALPINE_GLIBC_PACKAGE_VERSION.apk" && \
ALPINE_GLIBC_I18N_PACKAGE_FILENAME="glibc-i18n-$ALPINE_GLIBC_PACKAGE_VERSION.apk" && \
apk add --no-cache --virtual=build-dependencies wget ca-certificates && \
wget \
"https://github.com/sgerrand/alpine-pkg-glibc/releases/download/$ALPINE_GLIBC_PACKAGE_VERSION/sgerrand.rsa.pub" \
-O "/etc/apk/keys/sgerrand.rsa.pub" && \
wget \
"$ALPINE_GLIBC_BASE_URL/$ALPINE_GLIBC_PACKAGE_VERSION/$ALPINE_GLIBC_BASE_PACKAGE_FILENAME" \
"$ALPINE_GLIBC_BASE_URL/$ALPINE_GLIBC_PACKAGE_VERSION/$ALPINE_GLIBC_BIN_PACKAGE_FILENAME" \
"$ALPINE_GLIBC_BASE_URL/$ALPINE_GLIBC_PACKAGE_VERSION/$ALPINE_GLIBC_I18N_PACKAGE_FILENAME" && \
apk add --no-cache \
"$ALPINE_GLIBC_BASE_PACKAGE_FILENAME" \
"$ALPINE_GLIBC_BIN_PACKAGE_FILENAME" \
"$ALPINE_GLIBC_I18N_PACKAGE_FILENAME" && \
\
rm "/etc/apk/keys/sgerrand.rsa.pub" && \
/usr/glibc-compat/bin/localedef --force --inputfile POSIX --charmap UTF-8 C.UTF-8 || true && \
echo "export LANG=C.UTF-8" > /etc/profile.d/locale.sh && \
\
apk del glibc-i18n && \
\
apk del build-dependencies && \
rm \
"$ALPINE_GLIBC_BASE_PACKAGE_FILENAME" \
"$ALPINE_GLIBC_BIN_PACKAGE_FILENAME" \
"$ALPINE_GLIBC_I18N_PACKAGE_FILENAME"
ENV LANG=C.UTF-8
ENV JAVA_VERSION=8 \
JAVA_UPDATE=77 \
JAVA_BUILD=03 \
JAVA_HOME="/usr/lib/jvm/default-jvm"
RUN apk add --no-cache --virtual=build-dependencies wget ca-certificates && \
cd "/tmp" && \
wget --header "Cookie: oraclelicense=accept-securebackup-cookie;" \
"http://download.oracle.com/otn-pub/java/jdk/${JAVA_VERSION}u${JAVA_UPDATE}-b${JAVA_BUILD}/jdk-${JAVA_VERSION}u${JAVA_UPDATE}-linux-x64.tar.gz" && \
tar -xzf "jdk-${JAVA_VERSION}u${JAVA_UPDATE}-linux-x64.tar.gz" && \
mkdir -p "/usr/lib/jvm" && \
mv "/tmp/jdk1.${JAVA_VERSION}.0_${JAVA_UPDATE}" "/usr/lib/jvm/java-${JAVA_VERSION}-oracle" && \
ln -s "java-${JAVA_VERSION}-oracle" "$JAVA_HOME" && \
ln -s "$JAVA_HOME/bin/"* "/usr/bin/" && \
rm -rf "$JAVA_HOME/"*src.zip && \
rm -rf "$JAVA_HOME/lib/missioncontrol" \
"$JAVA_HOME/lib/visualvm" \
"$JAVA_HOME/lib/"*javafx* \
"$JAVA_HOME/jre/lib/plugin.jar" \
"$JAVA_HOME/jre/lib/ext/jfxrt.jar" \
"$JAVA_HOME/jre/bin/javaws" \
"$JAVA_HOME/jre/lib/javaws.jar" \
"$JAVA_HOME/jre/lib/desktop" \
"$JAVA_HOME/jre/plugin" \
"$JAVA_HOME/jre/lib/"deploy* \
"$JAVA_HOME/jre/lib/"*javafx* \
"$JAVA_HOME/jre/lib/"*jfx* \
"$JAVA_HOME/jre/lib/amd64/libdecora_sse.so" \
"$JAVA_HOME/jre/lib/amd64/"libprism_*.so \
"$JAVA_HOME/jre/lib/amd64/libfxplugins.so" \
"$JAVA_HOME/jre/lib/amd64/libglass.so" \
"$JAVA_HOME/jre/lib/amd64/libgstreamer-lite.so" \
"$JAVA_HOME/jre/lib/amd64/"libjavafx*.so \
"$JAVA_HOME/jre/lib/amd64/"libjfx*.so && \
rm -rf "$JAVA_HOME/jre/bin/jjs" \
"$JAVA_HOME/jre/bin/keytool" \
"$JAVA_HOME/jre/bin/orbd" \
"$JAVA_HOME/jre/bin/pack200" \
"$JAVA_HOME/jre/bin/policytool" \
"$JAVA_HOME/jre/bin/rmid" \
"$JAVA_HOME/jre/bin/rmiregistry" \
"$JAVA_HOME/jre/bin/servertool" \
"$JAVA_HOME/jre/bin/tnameserv" \
"$JAVA_HOME/jre/bin/unpack200" \
"$JAVA_HOME/jre/lib/ext/nashorn.jar" \
"$JAVA_HOME/jre/lib/jfr.jar" \
"$JAVA_HOME/jre/lib/jfr" \
"$JAVA_HOME/jre/lib/oblique-fonts" && \
apk del build-dependencies && \
rm "/tmp/"*
# Maven
# as of 2016-06-12 maven apk is still in edge branch and not accessible by default
#RUN apk update && apk add maven=3.3.9-r0
ENV MAVEN_HOME="/usr/share/maven"
ENV MAVEN_VERSION="3.3.9"
RUN cd / && \
wget -q "http://archive.apache.org/dist/maven/maven-3/$MAVEN_VERSION/binaries/apache-maven-$MAVEN_VERSION-bin.tar.gz" -O - | tar xvzf - && \
mv /apache-maven-$MAVEN_VERSION /usr/share/maven && \
ln -s /usr/share/maven/bin/mvn /usr/bin/mvn
WORKDIR /usr/src/yasp
# Add package.json to get the NPM install cached.
ADD package.json /usr/src/yasp/
RUN npm install
# Add and build the java parser
ADD java_parser /usr/src/yasp/java_parser
RUN npm run maven
# Add everything else
ADD . /usr/src/yasp
RUN npm run webpack
ENV PATH /usr/src/yasp/node_modules/pm2/bin:$PATH
CMD [ "npm", "start" ]