From b5701455977a350d12644ea337d7c27140937c31 Mon Sep 17 00:00:00 2001 From: Shabab Qaisar <95719467+sqaisar@users.noreply.github.com> Date: Fri, 11 Apr 2025 14:33:29 +0500 Subject: [PATCH] feat: Add amd/arm64 for the docker image artifacts --- .github/workflows/release.yaml | 26 +++++++++++--------------- Dockerfile | 2 +- 2 files changed, 12 insertions(+), 16 deletions(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 1adefb63..125ef3c0 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -49,18 +49,14 @@ jobs: - name: Install Ginkgo run: go install github.com/onsi/ginkgo/v2/ginkgo@latest - - name: Build and Push - run: | - make docker-build docker-push - - docker tag wandb/controller:latest wandb/controller:${{ steps.release.outputs.new_release_version }} - docker push wandb/controller:${{ steps.release.outputs.new_release_version }} - - docker tag wandb/controller:latest wandb/controller:${{ steps.release.outputs.new_release_major_version }}.${{ steps.release.outputs.new_release_minor_version }} - docker push wandb/controller:${{ steps.release.outputs.new_release_major_version }}.${{ steps.release.outputs.new_release_minor_version }} - - docker tag wandb/controller:latest wandb/controller:${{ steps.release.outputs.new_release_major_version }} - docker push wandb/controller:${{ steps.release.outputs.new_release_major_version }} - env: - IMAGE_TAG_BASE: wandb/controller - VERSION: latest + - name: Build and Push Multi-arch Images + uses: docker/build-push-action@v4 + with: + context: . + push: true + platforms: linux/amd64,linux/arm64 + tags: | + sqaisar/wandb-operator:latest + sqaisar/wandb-operator:${{ steps.release.outputs.new_release_version }} + sqaisar/wandb-operator:${{ steps.release.outputs.new_release_major_version }}.${{ steps.release.outputs.new_release_minor_version }} + sqaisar/wandb-operator:${{ steps.release.outputs.new_release_major_version }} diff --git a/Dockerfile b/Dockerfile index 7f38b169..1b1ba2c8 100644 --- a/Dockerfile +++ b/Dockerfile @@ -25,7 +25,7 @@ COPY controllers/ controllers/ # was called. For example, if we call make docker-build in a local env which has the Apple Silicon M1 SO # the docker BUILDPLATFORM arg will be linux/arm64 when for Apple x86 it will be linux/amd64. Therefore, # by leaving it empty we can ensure that the container and binary shipped on it will have the same platform. -RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -a -o manager main.go +RUN CGO_ENABLED=0 GOOS=${TARGETOS} GOARCH=${TARGETARCH} go build -a -o manager main.go # Create a helm cache directory, set group ownership and permissions, and apply the sticky bit RUN mkdir -p /helm/.cache/helm /helm/.config/helm /helm/.local/share/helm && chmod -R 1777 /helm