Add support SAP JVM 8
authorJérôme Benoit <jerome.benoit@sap.com>
Fri, 25 Nov 2022 15:51:01 +0000 (16:51 +0100)
committerJérôme Benoit <jerome.benoit@sap.com>
Fri, 25 Nov 2022 15:51:01 +0000 (16:51 +0100)
Signed-off-by: Jérôme Benoit <jerome.benoit@sap.com>
Dockerfile
build-image.sh
docker-compose.yml

index 6271123e9cc00b70fbac1a39f291a8252bc78858..6635664fb8d14e6db5c8fd0ae877530b930225e9 100644 (file)
@@ -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
index b065201f7904604a34b519559862fed0c59b8013..50ae20a21922e71e179822caf7fb590aa7b4839b 100755 (executable)
@@ -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"
 
index 947c14bb18583b1d9030597c3835a65269bb87e4..89d6c0a6a84af6ab64a0fc84927930f6ab9cb0c3 100644 (file)
@@ -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