Update Dockerfile to auto switch the architecture

This commit is contained in:
AllinolCP 2023-08-27 15:23:18 +07:00 committed by GitHub
parent e2ce0fa370
commit f893f273e0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,4 +1,5 @@
FROM python:3-alpine
ARG TARGETARCH
RUN apk add \
openssl \
@ -10,10 +11,10 @@ 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