-
Notifications
You must be signed in to change notification settings - Fork 35
/
Dockerfile
85 lines (79 loc) · 3.64 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
# (C) Copyright IBM Corporation 2016, 2017
#
# ------------------------------------------------------------------------------
# NOTE: THIS DOCKERFILE IS GENERATED VIA "update.sh"
#
# PLEASE DO NOT EDIT IT DIRECTLY.
# ------------------------------------------------------------------------------
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
FROM alpine:3.6
MAINTAINER Dinakar Guniguntala <dinakar.g@in.ibm.com> (@dinogun)
RUN apk --update add --no-cache ca-certificates curl openssl binutils xz \
&& GLIBC_VER="2.25-r0" \
&& ALPINE_GLIBC_REPO="https://github.com/sgerrand/alpine-pkg-glibc/releases/download" \
&& curl -Ls ${ALPINE_GLIBC_REPO}/${GLIBC_VER}/glibc-${GLIBC_VER}.apk > /tmp/${GLIBC_VER}.apk \
&& apk add --allow-untrusted /tmp/${GLIBC_VER}.apk \
&& curl -Ls https://www.archlinux.org/packages/core/x86_64/gcc-libs/download > /tmp/gcc-libs.tar.xz \
&& mkdir /tmp/gcc \
&& tar -xf /tmp/gcc-libs.tar.xz -C /tmp/gcc \
&& mv /tmp/gcc/usr/lib/libgcc* /tmp/gcc/usr/lib/libstdc++* /usr/glibc-compat/lib \
&& strip /usr/glibc-compat/lib/libgcc_s.so.* /usr/glibc-compat/lib/libstdc++.so* \
&& apk del curl binutils \
&& rm -rf /tmp/${GLIBC_VER}.apk /tmp/gcc /tmp/gcc-libs.tar.xz /var/cache/apk/*
ENV JAVA_VERSION 1.8.0_sr5fp15
RUN set -eux; \
ARCH="$(apk --print-arch)"; \
case "${ARCH}" in \
amd64|x86_64) \
ESUM='0dd6345d706fa911637dcccb1302332adfad7921eecbf407696e951dda6268be'; \
YML_FILE='sdk/linux/x86_64/index.yml'; \
;; \
i386) \
ESUM='9d7e1f6d711dc8bd235e4cb78c7484ab73446e36c158422092065dcd3473ab6b'; \
YML_FILE='sdk/linux/i386/index.yml'; \
;; \
ppc64el|ppc64le) \
ESUM='c3bb4e7b87020bf25e746abec33b6173ab0de29eb783a3512f6cf0a85b0ea92a'; \
YML_FILE='sdk/linux/ppc64le/index.yml'; \
;; \
s390) \
ESUM='f86ba6be31d58b4ae46d9b19801932d855036b894984bab47b4627f4a0405f41'; \
YML_FILE='sdk/linux/s390/index.yml'; \
;; \
s390x) \
ESUM='c633b05621da5f97675e934d9d02fb7e9da078f53f5ed5b28f8e5bd9028e7760'; \
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=/opt/ibm/java" >> /tmp/response.properties; \
echo "LICENSE_ACCEPTED=TRUE" >> /tmp/response.properties; \
mkdir -p /opt/ibm; \
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;
ENV JAVA_HOME=/opt/ibm/java/jre \
PATH=/opt/ibm/java/bin:$PATH