From f893f273e06e71a7d9e32a44d54216434e507b1b Mon Sep 17 00:00:00 2001 From: AllinolCP <56921534+AllinolCP@users.noreply.github.com> Date: Sun, 27 Aug 2023 15:23:18 +0700 Subject: [PATCH] Update Dockerfile to auto switch the architecture --- Dockerfile | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/Dockerfile b/Dockerfile index eaf1f26..68bc0e9 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,5 @@ FROM python:3-alpine +ARG TARGETARCH RUN apk add \ openssl \ @@ -10,12 +11,12 @@ RUN apk add \ WORKDIR /usr/src/houdini -ENV DOCKERIZE_VERSION v0.6.1 -RUN wget https://github.com/jwilder/dockerize/releases/download/$DOCKERIZE_VERSION/dockerize-alpine-linux-amd64-$DOCKERIZE_VERSION.tar.gz \ - && tar -C /usr/local/bin -xzvf dockerize-alpine-linux-amd64-$DOCKERIZE_VERSION.tar.gz \ - && rm dockerize-alpine-linux-amd64-$DOCKERIZE_VERSION.tar.gz +ENV DOCKERIZE_VERSION v0.7.0 +RUN ARCH=$(arch | sed s/aarch64/arm64/ | sed s/x86_64/amd64/) && wget https://github.com/jwilder/dockerize/releases/download/$DOCKERIZE_VERSION/dockerize-alpine-linux-$ARCH-$DOCKERIZE_VERSION.tar.gz \ + && tar -C /usr/local/bin -xzvf dockerize-alpine-linux-$ARCH-$DOCKERIZE_VERSION.tar.gz \ + && rm dockerize-alpine-linux-$ARCH-$DOCKERIZE_VERSION.tar.gz COPY requirements.txt ./ RUN pip install --no-cache-dir -r requirements.txt -ENTRYPOINT [ "python", "./bootstrap.py" ] \ No newline at end of file +ENTRYPOINT [ "python", "./bootstrap.py" ]