From 2fc920836f5b071bb187d35dea506542c985f00f Mon Sep 17 00:00:00 2001 From: woa7 <7572779+woa7@users.noreply.github.com> Date: Wed, 21 Oct 2020 19:05:59 +0100 Subject: [PATCH] add function for arm64, arm and 386 --- ubi/Dockerfile | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/ubi/Dockerfile b/ubi/Dockerfile index e645db0..02f78d4 100644 --- a/ubi/Dockerfile +++ b/ubi/Dockerfile @@ -5,6 +5,14 @@ ARG VAULT_VERSION=1.5.4 # Set up certificates, our base tools, and Vault. RUN set -eux; \ + osArch="$(uname -m)"; \ + case "$osArch" in \ + armhf) ARCH='arm' ;; \ + aarch64) ARCH='arm64' ;; \ + x86_64) ARCH='amd64' ;; \ + x86) ARCH='386' ;; \ + *) echo >&2 "error: unsupported architecture: $osArch"; exit 1 ;; \ + esac && \ microdnf install -y ca-certificates gnupg openssl libcap tzdata wget unzip procps shadow-utils util-linux && \ VAULT_GPGKEY=91A6E7F85D05C65630BEF18951852D87348FFC4C; \ found=''; \ @@ -19,12 +27,12 @@ RUN set -eux; \ test -z "$found" && echo >&2 "error: failed to fetch GPG key $VAULT_GPGKEY" && exit 1; \ mkdir -p /tmp/build && \ cd /tmp/build && \ - wget https://releases.hashicorp.com/vault/${VAULT_VERSION}/vault_${VAULT_VERSION}_linux_amd64.zip && \ + wget https://releases.hashicorp.com/vault/${VAULT_VERSION}/vault_${VAULT_VERSION}_linux_${ARCH}.zip && \ wget https://releases.hashicorp.com/vault/${VAULT_VERSION}/vault_${VAULT_VERSION}_SHA256SUMS && \ wget https://releases.hashicorp.com/vault/${VAULT_VERSION}/vault_${VAULT_VERSION}_SHA256SUMS.sig && \ gpg --batch --verify vault_${VAULT_VERSION}_SHA256SUMS.sig vault_${VAULT_VERSION}_SHA256SUMS && \ - grep vault_${VAULT_VERSION}_linux_amd64.zip vault_${VAULT_VERSION}_SHA256SUMS | sha256sum -c && \ - unzip -d /bin vault_${VAULT_VERSION}_linux_amd64.zip && \ + grep vault_${VAULT_VERSION}_linux_${ARCH}.zip vault_${VAULT_VERSION}_SHA256SUMS | sha256sum -c && \ + unzip -d /bin vault_${VAULT_VERSION}_linux_${ARCH}.zip && \ cd /tmp && \ rm -rf /tmp/build && \ gpgconf --kill dirmngr && \