From: Jérôme Benoit Date: Fri, 25 Nov 2022 15:51:01 +0000 (+0100) Subject: Add support SAP JVM 8 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=28df4c45ae73bd91f83ffc99fadc12a24175b99a;p=mbt-docker.git Add support SAP JVM 8 Signed-off-by: Jérôme Benoit --- diff --git a/Dockerfile b/Dockerfile index 6271123..6635664 100644 --- a/Dockerfile +++ b/Dockerfile @@ -113,30 +113,55 @@ RUN set -ex \ ARG SAPMACHINE_VERSION=11.0.17 -RUN ARCH= && dpkgArch="$(dpkg --print-architecture)" \ - && case "${dpkgArch##*-}" in \ +RUN sapmachine_install() { \ + ARCH=; \ + dpkgArch="$(dpkg --print-architecture)"; \ + case "${dpkgArch##*-}" in \ amd64) ARCH='amd64';; \ *) echo "unsupported architecture"; exit 1 ;; \ - esac \ + esac; \ + apt-get update; \ + apt-get install -y ca-certificates gnupg dirmngr --no-install-recommends; \ + rm -rf /var/lib/apt/lists/*; \ + export GNUPGHOME="$(mktemp -d)"; \ + for key in \ + CACB9FE09150307D1D22D82962754C3B3ABCFE23 \ + ; do \ + gpg --no-default-keyring --keyring gnupg-ring:/etc/apt/trusted.gpg.d/sapmachine.gpg --batch --keyserver hkps://keys.openpgp.org --recv-keys "$key" || \ + gpg --no-default-keyring --keyring gnupg-ring:/etc/apt/trusted.gpg.d/sapmachine.gpg --batch --keyserver hkps://keyserver.ubuntu.com --recv-keys "$key" ; \ + done; \ + chmod 644 /etc/apt/trusted.gpg.d/sapmachine.gpg; \ + echo "deb http://dist.sapmachine.io/debian/${ARCH}/ ./" | tee /etc/apt/sources.list.d/sapmachine.list; \ + apt-get update; \ + apt-get install -y sapmachine-$(echo ${SAPMACHINE_VERSION} | cut -d. -f1)-jdk=${SAPMACHINE_VERSION} --no-install-recommends; \ + rm -rf "$GNUPGHOME" /var/lib/apt/lists/*; \ + apt-get remove --purge --autoremove -y ca-certificates gnupg dirmngr; \ + }; \ + sapjvm_install() { \ + ARCH=; \ + dpkgArch="$(dpkg --print-architecture)"; \ + case "${dpkgArch##*-}" in \ + amd64) ARCH='x64';; \ + ppc64el) ARCH='ppc64le';; \ + *) echo "unsupported architecture"; exit 1 ;; \ + esac; \ + apt-get update; \ + apt-get install -y ca-certificates curl libarchive-tools --no-install-recommends; \ + rm -rf /var/lib/apt/lists/*; \ + curl -fsSLO --compressed -b 'eula_3_1_agreed=tools.hana.ondemand.com/developer-license-3_1.txt' https://tools.hana.ondemand.com/additional/sapjvm-${SAPMACHINE_VERSION}-linux-${ARCH}.zip; \ + echo "583dedfeee0c119839a610ddc8c6768d0c044429 sapjvm-${SAPMACHINE_VERSION}-linux-${ARCH}.zip" | sha1sum -c -; \ + bsdtar xvf sapjvm-${SAPMACHINE_VERSION}-linux-${ARCH}.zip -C /usr/local --strip-components=1; \ + rm -f sapjvm-${SAPMACHINE_VERSION}-linux-${ARCH}.zip; \ + apt-get remove --purge --auto-remove -y ca-certificates curl libarchive-tools; \ + } \ && set -ex \ - && apt-get update \ - && apt-get install -y ca-certificates gnupg dirmngr --no-install-recommends \ - && rm -rf /var/lib/apt/lists/* \ - && export GNUPGHOME="$(mktemp -d)" \ - && for key in \ - CACB9FE09150307D1D22D82962754C3B3ABCFE23 \ - ; do \ - gpg --no-default-keyring --keyring gnupg-ring:/etc/apt/trusted.gpg.d/sapmachine.gpg --batch --keyserver hkps://keys.openpgp.org --recv-keys "$key" || \ - gpg --no-default-keyring --keyring gnupg-ring:/etc/apt/trusted.gpg.d/sapmachine.gpg --batch --keyserver hkps://keyserver.ubuntu.com --recv-keys "$key" ; \ - done \ - && chmod 644 /etc/apt/trusted.gpg.d/sapmachine.gpg \ - && echo "deb http://dist.sapmachine.io/debian/${ARCH}/ ./" | tee /etc/apt/sources.list.d/sapmachine.list \ - && apt-get update \ - && apt-get install -y sapmachine-$(echo ${SAPMACHINE_VERSION} | cut -d. -f1)-jdk=${SAPMACHINE_VERSION} --no-install-recommends \ - && rm -rf "$GNUPGHOME" /var/lib/apt/lists/* \ - && apt-get remove --purge --autoremove -y ca-certificates gnupg dirmngr \ + && if [ $(echo ${SAPMACHINE_VERSION} | cut -d. -f1) -le 8 ]; then \ + sapjvm_install; \ + else \ + sapmachine_install; \ + fi \ # smoke test - && java --version + && java -version; ARG MAVEN_VERSION=3.8.6 ARG BASE_URL=https://downloads.apache.org/maven/maven-3/${MAVEN_VERSION}/binaries diff --git a/build-image.sh b/build-image.sh index b065201..50ae20a 100755 --- a/build-image.sh +++ b/build-image.sh @@ -2,7 +2,8 @@ shopt -s extglob -images="mbt-node14-java11-docker mbt-node16-java11-docker mbt-node18-java11-docker \ +images="mbt-node14-java8-docker mbt-node16-java8-docker mbt-node18-java8-docker \ + mbt-node14-java11-docker mbt-node16-java11-docker mbt-node18-java11-docker \ mbt-node14-java17-docker mbt-node16-java17-docker mbt-node18-java17-docker \ mbt-node14-java19-docker mbt-node16-java19-docker mbt-node18-java19-docker" diff --git a/docker-compose.yml b/docker-compose.yml index 947c14b..89d6c0a 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -4,6 +4,27 @@ services: mbt-docker: platform: linux/amd64 build: + dockerfile: dockerfile + mbt-node18-java8-docker: + platform: linux/amd64 + build: + args: + NODE_VERSION: 18.12.1 + SAPMACHINE_VERSION: 8.1.091 + dockerfile: Dockerfile + mbt-node16-java8-docker: + platform: linux/amd64 + build: + args: + NODE_VERSION: 16.18.1 + SAPMACHINE_VERSION: 8.1.091 + dockerfile: Dockerfile + mbt-node14-java8-docker: + platform: linux/amd64 + build: + args: + NODE_VERSION: 14.21.1 + SAPMACHINE_VERSION: 8.1.091 dockerfile: Dockerfile mbt-node18-java11-docker: platform: linux/amd64