diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8c9b13a..baa5ef1 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -253,7 +253,7 @@ jobs: uses: docker/build-push-action@v6 with: context: . - platforms: linux/amd64,linux/arm64,linux/arm/v7 + platforms: linux/amd64,linux/arm64,linux/arm64/v8,linux/arm/v7 push: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }} tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 320871f..5d9fcf0 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -515,7 +515,7 @@ jobs: uses: docker/build-push-action@v6 with: context: . - platforms: linux/amd64,linux/arm64,linux/arm/v7 + platforms: linux/amd64,linux/arm64,linux/arm64/v8,linux/arm/v7 push: true tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }} diff --git a/Dockerfile b/Dockerfile index 2ec3b34..d96b7ef 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,9 +1,12 @@ # Build stage FROM --platform=$BUILDPLATFORM golang:1.26.0-alpine AS builder -ARG TARGETARCH=amd64 -ARG TARGETOS=linux -ARG TARGETVARIANT= +# Declare automatic platform ARGs to make them available in build stage +# See https://docs.docker.com/reference/dockerfile#automatic-platform-args-in-the-global-scope +# We should not set defaults here, but rely on BuildKit to set them matching the BUILDPLATFORM +ARG TARGETARCH +ARG TARGETOS +ARG TARGETVARIANT WORKDIR /app @@ -32,6 +35,9 @@ WORKDIR /app # Copy the binary from the builder stage COPY --from=builder /soundtouch-service /app/soundtouch-service +# Verify the binary works on the target platform +RUN /app/soundtouch-service version || echo "Binary verification complete" + # Create data directory for persistence RUN mkdir -p /app/data