Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix arm64 builds #484

Merged
merged 7 commits into from
Aug 16, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 8 additions & 6 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,29 +1,31 @@
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 \
&& rm -rf /var/lib/apt/lists/*

# 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
Expand Down
Loading