From 75fe60b4c96d18ee31f6bb81cce2903cb41a0348 Mon Sep 17 00:00:00 2001 From: Zoe <62722391+juls0730@users.noreply.github.com> Date: Tue, 30 Sep 2025 20:20:25 -0500 Subject: [PATCH] arm64 docker image builds --- .github/workflows/docker-publish.yml | 8 ++++++++ Dockerfile | 22 +++++++++++++++++----- 2 files changed, 25 insertions(+), 5 deletions(-) diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml index cae9e4e..b93dac6 100644 --- a/.github/workflows/docker-publish.yml +++ b/.github/workflows/docker-publish.yml @@ -27,6 +27,13 @@ jobs: username: ${{ github.actor }} password: ${{ env.OCI_TOKEN }} + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + + - name: Set up Docker Buildx + id: buildx + uses: docker/setup-buildx-action@v3 + - name: Extract Docker metadata id: meta uses: docker/metadata-action@v5 @@ -40,3 +47,4 @@ jobs: push: true tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }} + platforms: linux/amd64,linux/arm64 diff --git a/Dockerfile b/Dockerfile index 9310096..d9b13dd 100644 --- a/Dockerfile +++ b/Dockerfile @@ -3,21 +3,33 @@ FROM golang:1.25 AS builder # build dependencies RUN apt update && apt install -y upx -RUN curl -sLO https://github.com/tailwindlabs/tailwindcss/releases/download/v4.1.13/tailwindcss-linux-x64 -RUN chmod +x tailwindcss-linux-x64 -RUN mv tailwindcss-linux-x64 /usr/local/bin/tailwindcss +ARG TARGETARCH +RUN set -eux; \ + echo "Building for architecture: ${TARGETARCH}"; \ + case "${TARGETARCH}" in \ + "amd64") \ + arch_suffix='x64' ;; \ + "arm64") \ + arch_suffix='arm64' ;; \ + *) \ + echo "Unsupported architecture: ${TARGETARCH}" && exit 1 ;; \ + esac; \ + curl -sLO "https://github.com/tailwindlabs/tailwindcss/releases/download/v4.1.13/tailwindcss-linux-${arch_suffix}"; \ + mv "tailwindcss-linux-${arch_suffix}" /usr/local/bin/tailwindcss; \ + chmod +x /usr/local/bin/tailwindcss; + RUN go install github.com/juls0730/zqdgr@latest WORKDIR /app -ENV CGO_ENABLED=0 GOOS=linux GOARCH=amd64 +ARG TARGETARCH +ENV CGO_ENABLED=0 GOOS=linux GOARCH=${TARGETARCH} COPY go.mod go.sum ./ RUN go mod download COPY . . - RUN zqdgr build RUN upx passport