From d23de3a5c42b336b8e3285f3839b1a0cf7f13b4c Mon Sep 17 00:00:00 2001 From: Brandon Dunne Date: Wed, 2 Oct 2024 16:14:43 -0400 Subject: [PATCH] review feedback --- manageiq-operator/Dockerfile | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/manageiq-operator/Dockerfile b/manageiq-operator/Dockerfile index fdab2a35..e8e076f5 100644 --- a/manageiq-operator/Dockerfile +++ b/manageiq-operator/Dockerfile @@ -4,12 +4,9 @@ FROM registry.access.redhat.com/ubi9/ubi-minimal as builder COPY go.mod /go.mod RUN microdnf -y install gzip jq tar && \ - arch=$(uname -m) && \ - if [ ${arch} == "x86_64" ] ; then \ - arch="amd64" \ - ; fi && \ + arch=$(uname -m | sed 's/x86_64/amd64/') && \ goversion=$(sed -nr 's/^go\s+(.*)/go\1/p' /go.mod) && \ - file=$(curl -s 'https://go.dev/dl/?mode=json&include=all' | jq -r --arg GOVERSION "${goversion}" --arg ARCH "${arch}" 'map(select(.version | startswith($GOVERSION)))[0].files[] | select(.arch == $ARCH and .os == "linux").filename') && \ + file=$(curl -s 'https://go.dev/dl/?mode=json&include=all' | jq -r --arg GOVERSION "${goversion}" --arg ARCH "${arch}" 'first(.[] | select(.version | startswith($GOVERSION))).files[] | select(.arch == $ARCH and .os == "linux").filename') && \ curl -s -f -L https://go.dev/dl/${file} | tar -C / -xzf - ENV PATH=/go/bin:/root/.local/bin:/root/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin