From f85ea7b12369b6e7a33c8e66e91513cbcfdc0997 Mon Sep 17 00:00:00 2001 From: Robert Bartel Date: Thu, 22 Aug 2024 11:50:33 -0400 Subject: [PATCH] Account for platform in image mc client download. Account for building in environments other than Linux X86_64 when downloading the MinIO client for the ngen worker images. --- docker/main/ngen/Dockerfile | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/docker/main/ngen/Dockerfile b/docker/main/ngen/Dockerfile index 4a4d53db7..fc5dde1f7 100644 --- a/docker/main/ngen/Dockerfile +++ b/docker/main/ngen/Dockerfile @@ -914,7 +914,20 @@ USER root # https://dl.min.io/client/mc/release/linux-amd64/archive/mc.${MINIO_CLIENT_RELEASE} # Setup minio client; also update path and make sure dataset directory is there -RUN curl -L -o /dmod/bin/mc https://dl.min.io/client/mc/release/linux-amd64/mc \ +RUN OS_NAME=$(uname -s | tr '[:upper:]' '[:lower:]') \ + && PLATFORM=$(uname -m | tr '[:upper:]' '[:lower:]') \ + && case "${PLATFORM:?}" in \ + aarch64) \ + MINIO_HW_NAME=arm64 \ + ;; \ + x86_64) \ + MINIO_HW_NAME=amd64 \ + ;; \ + *) \ + MINIO_HW_NAME=${PLATFORM} \ + ;; \ + esac \ + && curl -L -o /dmod/bin/mc https://dl.min.io/client/mc/release/${OS_NAME}-${MINIO_HW_NAME}/mc \ && chmod +x /dmod/bin/mc \ && mkdir /dmod/.mc \ && echo "export PATH=${PATH}" >> /etc/profile \