From 865db469caef21b51d038113d194e6eb64f26de3 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=B4me=20Benoit?= Date: Mon, 3 Oct 2022 10:06:57 +0200 Subject: [PATCH] Add hardware architecture check at SAP machine installation MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Jérôme Benoit --- Dockerfile | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index cc013d8..5be6ec4 100644 --- a/Dockerfile +++ b/Dockerfile @@ -113,12 +113,17 @@ RUN set -ex \ ARG SAPMACHINE_VERSION=11.0.16.1 -RUN set -ex \ +RUN ARCH= && dpkgArch="$(dpkg --print-architecture)" \ + && case "${dpkgArch##*-}" in \ + amd64) ARCH='amd64';; \ + *) echo "unsupported architecture"; exit 1 ;; \ + esac \ + && set -ex \ && apt-get update \ && apt-get install -y ca-certificates wget --no-install-recommends \ && rm -rf /var/lib/apt/lists/* \ && wget -q -O - https://dist.sapmachine.io/debian/sapmachine.key | tee /etc/apt/trusted.gpg.d/sapmachine.gpg.asc \ - && echo "deb http://dist.sapmachine.io/debian/amd64/ ./" | tee /etc/apt/sources.list.d/sapmachine.list \ + && 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 /var/lib/apt/lists/* \ -- 2.34.1