forked from microclimate-dev2ops/rogue-cloud-client
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile-build
58 lines (54 loc) · 2.61 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
ENV JAVA_VERSION 1.8.0_sr5fp6
RUN set -eux; \
ARCH="$(dpkg --print-architecture)"; \
case "${ARCH}" in \
amd64|x86_64) \
ESUM='b5e2824313e62d647c7c7c7c8a6eb8704e445e915da460d379aedd30e6835030'; \
YML_FILE='sdk/linux/x86_64/index.yml'; \
;; \
i386) \
ESUM='5e2fd0cafeab9c72e8eb038eb22cf911a18607298a47cd3d4684179610ec364c'; \
YML_FILE='sdk/linux/i386/index.yml'; \
;; \
ppc64el|ppc64le) \
ESUM='c2dc7e1cf3db66f7ea0497b48ecb79048a553eaa82d5595a43c9bd7542610b0b'; \
YML_FILE='sdk/linux/ppc64le/index.yml'; \
;; \
s390) \
ESUM='5f3f12fefe36502954d69fb1178c2a8bcd88624bc77c4c7bafd9193adcc79398'; \
YML_FILE='sdk/linux/s390/index.yml'; \
;; \
s390x) \
ESUM='116fbee3c36425056d6310dd6ef54ce3debdd7150fa57e28caf39f04108b3edc'; \
YML_FILE='sdk/linux/s390x/index.yml'; \
;; \
*) \
echo "Unsupported arch: ${ARCH}"; \
exit 1; \
;; \
esac; \
BASE_URL="https://public.dhe.ibm.com/ibmdl/export/pub/systems/cloud/runtimes/java/meta/"; \
wget -q -U UA_IBM_JAVA_Docker -O /tmp/index.yml ${BASE_URL}/${YML_FILE}; \
JAVA_URL=$(cat /tmp/index.yml | sed -n '/'${JAVA_VERSION}'/{n;p}' | sed -n 's/\s*uri:\s//p' | tr -d '\r'); \
wget -q -U UA_IBM_JAVA_Docker -O /tmp/ibm-java.bin ${JAVA_URL}; \
echo "${ESUM} /tmp/ibm-java.bin" | sha256sum -c -; \
echo "INSTALLER_UI=silent" > /tmp/response.properties; \
echo "USER_INSTALL_DIR=/root/java" >> /tmp/response.properties; \
echo "LICENSE_ACCEPTED=TRUE" >> /tmp/response.properties; \
mkdir -p /root/java; \
chmod +x /tmp/ibm-java.bin; \
/tmp/ibm-java.bin -i silent -f /tmp/response.properties; \
rm -f /tmp/response.properties; \
rm -f /tmp/index.yml; \
rm -f /tmp/ibm-java.bin; \
cd /root/java/jre/lib; \
rm -rf icc;
RUN mkdir -p /opt/mvn; \
MAVEN_VERSION=$(wget -qO- https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/maven-metadata.xml | sed -n 's/\s*<release>\(.*\)<.*>/\1/p'); \
wget -q -U UA_IBM_JAVA_Docker -O /opt/mvn/apache-maven-${MAVEN_VERSION}-bin.tar.gz https://search.maven.org/remotecontent?filepath=org/apache/maven/apache-maven/${MAVEN_VERSION}/apache-maven-${MAVEN_VERSION}-bin.tar.gz; \
tar xf /opt/mvn/apache-maven-${MAVEN_VERSION}-bin.tar.gz -C /opt/mvn; \
mv /opt/mvn/apache-maven-${MAVEN_VERSION} /opt/mvn/apache-maven; \
rm -f /opt/mvn/apache-maven-${MAVEN_VERSION}-bin.tar.gz;
RUN mkdir -m 777 -p /config/resources
ENV JAVA_HOME=/root/java \
PATH=/root/java/jre/bin:/opt/mvn/apache-maven/bin:$PATH