From db044aecaada7d131285c7b64889738ad0b1d6b7 Mon Sep 17 00:00:00 2001 From: Tyler Baker Date: Tue, 5 Nov 2024 14:44:50 -0800 Subject: [PATCH] detect host architecture Signed-off-by: Tyler Baker --- Dockerfile | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 6b410d9a..ada5e6cc 100644 --- a/Dockerfile +++ b/Dockerfile @@ -3,7 +3,12 @@ FROM ubuntu:20.04 AS container-tools ARG DEBIAN_FRONTEND=noninteractive RUN apt-get update && apt-get install -y wget git make \ - libgpgme-dev libassuan-dev libbtrfs-dev libdevmapper-dev pkg-config + libgpgme-dev libassuan-dev libbtrfs-dev libdevmapper-dev pkg-config \ + file + +# Detect host architecture +RUN file /bin/bash | grep -q x86-64 && echo amd64 > /tmp/arch || true +RUN file /bin/bash | grep -q aarch64 && echo arm64 > /tmp/arch || true RUN wget -P /tmp https://go.dev/dl/go1.18.linux-amd64.tar.gz && \ tar -C /usr/local -xzf /tmp/go1.18.linux-amd64.tar.gz @@ -17,7 +22,12 @@ RUN git clone https://github.com/containers/skopeo.git /skopeo && \ # Build ostreeuploader, aka fiopush/fiocheck FROM ubuntu:20.04 AS fiotools RUN apt-get update -RUN apt-get install -y wget git gcc make +RUN apt-get install -y wget git gcc make file + +# Detect host architecture +RUN file /bin/bash | grep -q x86-64 && echo amd64 > /tmp/arch || true +RUN file /bin/bash | grep -q aarch64 && echo arm64 > /tmp/arch || true + RUN wget -P /tmp https://go.dev/dl/go1.19.9.linux-amd64.tar.gz && \ tar -C /usr/local -xzf /tmp/go1.19.9.linux-amd64.tar.gz ENV PATH /usr/local/go/bin:$PATH