From 60a333e9488ac88510b159e9c7cd44724cac0546 Mon Sep 17 00:00:00 2001 From: sanderegg <35365065+sanderegg@users.noreply.github.com> Date: Thu, 19 Dec 2024 15:48:03 +0100 Subject: [PATCH] install right architecture --- services/agent/Dockerfile | 4 ++++ services/dynamic-sidecar/Dockerfile | 9 ++++++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/services/agent/Dockerfile b/services/agent/Dockerfile index 3c7469ac92b..e2920791520 100644 --- a/services/agent/Dockerfile +++ b/services/agent/Dockerfile @@ -3,10 +3,12 @@ # Define arguments in the global scope ARG PYTHON_VERSION="3.11.9" ARG UV_VERSION="0.4" + FROM ghcr.io/astral-sh/uv:${UV_VERSION} AS uv_build # we docker image is built based on debian FROM python:${PYTHON_VERSION}-slim-bookworm AS base + # # USAGE: # cd sercices/agent @@ -57,6 +59,8 @@ ENV PYTHONDONTWRITEBYTECODE=1 \ ENV PATH="${VIRTUAL_ENV}/bin:$PATH" # rclone installation +ARG TARGETARCH +ENV TARGETARCH=${TARGETARCH} RUN \ --mount=type=bind,source=scripts/install_rclone.bash,target=/tmp/install_rclone.bash \ ./tmp/install_rclone.bash diff --git a/services/dynamic-sidecar/Dockerfile b/services/dynamic-sidecar/Dockerfile index a5173e7f19a..fdc6369ae57 100644 --- a/services/dynamic-sidecar/Dockerfile +++ b/services/dynamic-sidecar/Dockerfile @@ -53,12 +53,19 @@ RUN \ && gosu nobody true # install RClone, we do it in a separate layer such that the cache is not locked forever, as this seems to take a long time +ARG TARGETARCH +ENV TARGETARCH=${TARGETARCH} RUN \ --mount=type=bind,source=scripts/install_rclone.bash,target=install_rclone.bash \ ./install_rclone.bash RUN AWS_CLI_VERSION="2.11.11" \ - && curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64-${AWS_CLI_VERSION}.zip" -o "awscliv2.zip" \ + && case "${TARGETARCH}" in \ + "amd64") ARCH="x86_64" ;; \ + "arm64") ARCH="aarch64" ;; \ + *) echo "Unsupported architecture: ${TARGETARCH}" && exit 1 ;; \ + esac \ + && curl "https://awscli.amazonaws.com/awscli-exe-linux-${ARCH}-${AWS_CLI_VERSION}.zip" -o "awscliv2.zip" \ && apt-get update && apt-get install -y unzip \ && unzip awscliv2.zip \ && ./aws/install \