From: Jérôme Benoit Date: Fri, 20 Jan 2023 17:01:20 +0000 (+0100) Subject: Merge branch 'main' of https://github.tools.sap/E-Mobility/mbt-docker into multiple... X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=1cdac27aed9aa848fdab567d489ff4533f6f0099;hp=-c;p=mbt-docker.git Merge branch 'main' of https://github.tools.sap/E-Mobility/mbt-docker into multiple-images --- 1cdac27aed9aa848fdab567d489ff4533f6f0099 diff --combined Dockerfile index 1cdbf51,733941d..31d6374 --- a/Dockerfile +++ b/Dockerfile @@@ -115,56 -115,30 +115,56 @@@ ARG SAPMACHINE_VERSION=11.0.1 ENV JAVA_HOME /opt/jdk -RUN ARCH=; SAPMACHINE_MAJOR_VERSION=$(echo ${SAPMACHINE_VERSION} | cut -d. -f1) \ - && dpkgArch="$(dpkg --print-architecture)" \ - && case "${dpkgArch##*-}" in \ +RUN sapmachine_install() { \ + SAPMACHINE_MAJOR_VERSION=$(echo ${SAPMACHINE_VERSION} | cut -d. -f1); \ + 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-${SAPMACHINE_MAJOR_VERSION}-jdk=${SAPMACHINE_VERSION} --no-install-recommends; \ + rm -rf "$GNUPGHOME" /var/lib/apt/lists/*; \ + apt-get remove --purge --autoremove -y ca-certificates gnupg dirmngr; \ + ln -s /usr/lib/jvm/sapmachine-${SAPMACHINE_MAJOR_VERSION} ${JAVA_HOME}; \ + }; \ + 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 --no-same-owner; \ + rm -f sapjvm-${SAPMACHINE_VERSION}-linux-${ARCH}.zip; \ + apt-get remove --purge --auto-remove -y ca-certificates curl libarchive-tools; \ + ln -s /usr/local ${JAVA_HOME}; \ + } \ && 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-${SAPMACHINE_MAJOR_VERSION}-jdk=${SAPMACHINE_VERSION} --no-install-recommends \ - && rm -rf "$GNUPGHOME" /var/lib/apt/lists/* \ - && apt-get remove --purge --autoremove -y ca-certificates gnupg dirmngr \ - && ln -s /usr/lib/jvm/sapmachine-${SAPMACHINE_MAJOR_VERSION} ${JAVA_HOME} \ + && if [ $(echo ${SAPMACHINE_VERSION} | cut -d. -f1) -le 8 ]; then \ + sapjvm_install; \ + else \ + sapmachine_install; \ + fi \ # smoke test && java -version @@@ -214,7 -188,8 +214,8 @@@ RUN set -ex && python3 --version # Allow global npm packages install without sudo - RUN mkdir ${USER_HOME_DIR}/.npm-global \ + RUN set -ex \ + && mkdir ${USER_HOME_DIR}/.npm-global \ && chown ${USER}:${USER} ${USER_HOME_DIR}/.npm-global ENV NPM_CONFIG_PREFIX ${USER_HOME_DIR}/.npm-global