From: Jérôme Benoit Date: Sat, 26 Nov 2022 05:43:57 +0000 (+0100) Subject: Ensure JAVA_HOME is defined as ENV X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=ac69ff88a0d57777bc46a7439e12746c79852c21;p=mbt-docker.git Ensure JAVA_HOME is defined as ENV Signed-off-by: Jérôme Benoit --- diff --git a/Dockerfile b/Dockerfile index 5461f15..8db5147 100644 --- a/Dockerfile +++ b/Dockerfile @@ -113,7 +113,10 @@ RUN set -ex \ ARG SAPMACHINE_VERSION=11.0.17 +ENV JAVA_HOME /opt/jdk + RUN sapmachine_install() { \ + SAPMACHINE_MAJOR_VERSION=$(echo ${SAPMACHINE_VERSION} | cut -d. -f1); \ ARCH=; \ dpkgArch="$(dpkg --print-architecture)"; \ case "${dpkgArch##*-}" in \ @@ -133,9 +136,10 @@ RUN sapmachine_install() { \ 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; \ + 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=; \ @@ -153,6 +157,7 @@ RUN sapmachine_install() { \ 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; \ + ln -s /usr/local ${JAVA_HOME}; \ } \ && set -ex \ && if [ $(echo ${SAPMACHINE_VERSION} | cut -d. -f1) -le 8 ]; then \