From 59008ae90e43a363938d8611eaa0a2807798676b Mon Sep 17 00:00:00 2001 From: Debanjum Date: Wed, 11 Dec 2024 00:21:29 -0800 Subject: [PATCH] Use buildx to create multi platform docker image --- .github/workflows/dockerize.yml | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/.github/workflows/dockerize.yml b/.github/workflows/dockerize.yml index 79c3f483..eae321aa 100644 --- a/.github/workflows/dockerize.yml +++ b/.github/workflows/dockerize.yml @@ -120,6 +120,9 @@ jobs: runs-on: ubuntu-latest if: github.event_name != 'pull_request' steps: + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + - name: Login to GitHub Container Registry uses: docker/login-action@v2 with: @@ -130,15 +133,15 @@ jobs: - name: Create and Push Local Manifest if: github.event.inputs.khoj == 'true' || github.event_name == 'push' run: | - docker manifest create ghcr.io/${{ github.repository }}:${{ env.DOCKER_IMAGE_TAG }} \ + docker buildx imagetools create \ + -t ghcr.io/${{ github.repository }}:${{ env.DOCKER_IMAGE_TAG }} \ ghcr.io/${{ github.repository }}:${{ env.DOCKER_IMAGE_TAG }}-amd64 \ ghcr.io/${{ github.repository }}:${{ env.DOCKER_IMAGE_TAG }}-arm64 - docker manifest push ghcr.io/${{ github.repository }}:${{ env.DOCKER_IMAGE_TAG }} - name: Create and Push Cloud Manifest if: github.event.inputs.khoj-cloud == 'true' || github.event_name == 'push' run: | - docker manifest create ghcr.io/${{ github.repository }}-cloud:${{ env.DOCKER_IMAGE_TAG }} \ + docker buildx imagetools create \ + -t ghcr.io/${{ github.repository }}-cloud:${{ env.DOCKER_IMAGE_TAG }} \ ghcr.io/${{ github.repository }}-cloud:${{ env.DOCKER_IMAGE_TAG }}-amd64 \ ghcr.io/${{ github.repository }}-cloud:${{ env.DOCKER_IMAGE_TAG }}-arm64 - docker manifest push ghcr.io/${{ github.repository }}-cloud:${{ env.DOCKER_IMAGE_TAG }}