From 41dd30ecdc6c490b6da295828e97a51e71e800cc Mon Sep 17 00:00:00 2001 From: Isaac Date: Fri, 16 Aug 2024 18:54:07 -0500 Subject: [PATCH] fix arm64 builds (#484) --- Dockerfile | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/Dockerfile b/Dockerfile index d78eec7..d44f1e1 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,13 +1,13 @@ ARG TWITCHDOWNLOADER_VERSION="1.55.0" # Build stage -FROM --platform=$BUILDPLATFORM golang:1.22-bookworm AS build +FROM golang:1.22-bookworm AS build WORKDIR /app COPY . . RUN make build_server build_worker # Tools stage -FROM --platform=$BUILDPLATFORM debian:bookworm-slim AS tools +FROM debian:bookworm-slim AS tools WORKDIR /tmp RUN apt-get update && apt-get install -y --no-install-recommends \ unzip git ca-certificates curl \ @@ -15,15 +15,17 @@ unzip git ca-certificates curl \ # Download TwitchDownloader for the correct platform ARG TWITCHDOWNLOADER_VERSION -ENV TWITCHDOWNLOADER_URL=https://github.com/lay295/TwitchDownloader/releases/download/${TWITCHDOWNLOADER_VERSION}/TwitchDownloaderCLI-${TWITCHDOWNLOADER_VERSION}-Linux -RUN if [ "$BUILDPLATFORM" = "arm64" ]; then \ - export TWITCHDOWNLOADER_URL=${TWITCHDOWNLOADER_URL}Arm; \ +ENV TWITCHDOWNLOADER_URL=https://github.com/lay295/TwitchDownloader/releases/download/${TWITCHDOWNLOADER_VERSION}/TwitchDownloaderCLI-${TWITCHDOWNLOADER_VERSION}-Linux-x64.zip + + +RUN if [ "$(uname -m)" = "aarch64" ]; then \ +TWITCHDOWNLOADER_URL=https://github.com/lay295/TwitchDownloader/releases/download/${TWITCHDOWNLOADER_VERSION}/TwitchDownloaderCLI-${TWITCHDOWNLOADER_VERSION}-LinuxArm64.zip; \ fi && \ - export TWITCHDOWNLOADER_URL=${TWITCHDOWNLOADER_URL}-x64.zip && \ echo "Download URL: $TWITCHDOWNLOADER_URL" && \ curl -L $TWITCHDOWNLOADER_URL -o twitchdownloader.zip && \ unzip twitchdownloader.zip && \ rm twitchdownloader.zip + RUN git clone --depth 1 https://github.com/xenova/chat-downloader.git # Production stage