From 455f833a57c6e46c857d1dcc3e3f905b840e4395 Mon Sep 17 00:00:00 2001 From: Toby Bellwood Date: Wed, 24 Apr 2024 15:54:32 +1000 Subject: [PATCH] build: enable multiarch image build --- .github/workflows/build_and_publish.yml | 1 + Dockerfile | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build_and_publish.yml b/.github/workflows/build_and_publish.yml index 99eb14b..96429a1 100644 --- a/.github/workflows/build_and_publish.yml +++ b/.github/workflows/build_and_publish.yml @@ -52,6 +52,7 @@ jobs: uses: docker/build-push-action@v5 with: context: . + platforms: linux/amd64,linux/arm64 push: true tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }} diff --git a/Dockerfile b/Dockerfile index 2d4ff1c..46cd597 100644 --- a/Dockerfile +++ b/Dockerfile @@ -17,7 +17,7 @@ COPY internal/ internal/ COPY cmlib/ cmlib/ # Build -RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -a -o manager main.go +RUN CGO_ENABLED=0 GOOS=linux GOARCH=${ARCH} go build -a -o manager main.go # Use distroless as minimal base image to package the manager binary # Refer to https://github.com/GoogleContainerTools/distroless for more details