From 6bcfc8529851335e9df4924929a63dcaec2659e5 Mon Sep 17 00:00:00 2001 From: Stephen Simpson Date: Sat, 22 Mar 2025 09:22:25 -0500 Subject: [PATCH] Update Dockerfile to dynamically set architecture based on TARGETARCH for improved multi-architecture support --- Dockerfile | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/Dockerfile b/Dockerfile index 2b8f8b8..286263f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,11 +1,13 @@ FROM alpine:latest -# Set architecture as a build argument with a default value -ARG ARCH=x86_64 - RUN apk add --no-cache wget ca-certificates tar -RUN wget -q https://install.speedtest.net/app/cli/ookla-speedtest-1.2.0-linux-${ARCH}.tgz && \ +RUN if [ "$TARGETARCH" = "amd64" ]; then \ + ARCH="x86_64"; \ + elif [ "$TARGETARCH" = "arm64" ]; then \ + ARCH="aarch64"; \ + fi && \ + wget -q https://install.speedtest.net/app/cli/ookla-speedtest-1.2.0-linux-${ARCH}.tgz && \ tar -xzf ookla-speedtest-1.2.0-linux-${ARCH}.tgz -C /usr/bin && \ rm ookla-speedtest-1.2.0-linux-${ARCH}.tgz && \ chmod +x /usr/bin/speedtest