From b953bc08d992dbf24b294c0cb56f32a94b2c9ecf Mon Sep 17 00:00:00 2001 From: Salman Nawaz Date: Thu, 13 Jul 2023 17:27:31 +0500 Subject: [PATCH 1/2] fix: docker multi-arch image push --- .github/workflows/docker-publish.yml | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml index ddc2a944ca7..376f2925803 100644 --- a/.github/workflows/docker-publish.yml +++ b/.github/workflows/docker-publish.yml @@ -26,9 +26,21 @@ jobs: console.log('Will use tag: ' + tagName); return tagName; result-encoding: string + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v2 + + - name: Set up QEMU + uses: docker/setup-qemu-action@v2 + + - name: Login to DockerHub + uses: docker/login-action@v2 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_PASSWORD }} - name: Build and push Dev Docker image - uses: docker/build-push-action@v1 + uses: docker/build-push-action@v4 with: push: true username: ${{ secrets.DOCKERHUB_USERNAME }} @@ -36,11 +48,12 @@ jobs: target: dev repository: edxops/ecommerce-dev tags: ${{ steps.get-tag-name.outputs.result }},${{ github.sha }} + platforms: linux/amd64,linux/arm64 # The current priority is to get the devstack off of Ansible based Images. Once that is done, we can come back to this part to get # suitable images for smaller prod environments. # - name: Build and push prod Docker image - # uses: docker/build-push-action@v1 + # uses: docker/build-push-action@v4 # with: # push: true # username: ${{ secrets.DOCKERHUB_USERNAME }} @@ -48,3 +61,4 @@ jobs: # target: prod # repository: edxops/ecommerce-prod # tags: ${{ steps.get-tag-name.outputs.result }},${{ github.sha }} + # platforms: linux/amd64,linux/arm64 From ae1ed21c80349eea7c1bbee7f4d562807bf5ff63 Mon Sep 17 00:00:00 2001 From: Salman Nawaz Date: Tue, 18 Jul 2023 15:56:04 +0500 Subject: [PATCH 2/2] fix: docker multi-arch images, code improvements --- .github/workflows/docker-publish.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml index 376f2925803..9e48086f964 100644 --- a/.github/workflows/docker-publish.yml +++ b/.github/workflows/docker-publish.yml @@ -43,11 +43,11 @@ jobs: uses: docker/build-push-action@v4 with: push: true - username: ${{ secrets.DOCKERHUB_USERNAME }} - password: ${{ secrets.DOCKERHUB_PASSWORD }} target: dev repository: edxops/ecommerce-dev - tags: ${{ steps.get-tag-name.outputs.result }},${{ github.sha }} + tags: | + edxops/ecommerce-dev:${{ steps.get-tag-name.outputs.result }} + edxops/ecommerce-dev:${{ github.sha }} platforms: linux/amd64,linux/arm64 # The current priority is to get the devstack off of Ansible based Images. Once that is done, we can come back to this part to get @@ -56,9 +56,9 @@ jobs: # uses: docker/build-push-action@v4 # with: # push: true - # username: ${{ secrets.DOCKERHUB_USERNAME }} - # password: ${{ secrets.DOCKERHUB_PASSWORD }} # target: prod # repository: edxops/ecommerce-prod - # tags: ${{ steps.get-tag-name.outputs.result }},${{ github.sha }} + # tags: | + # edxops/ecommerce-prod:${{ steps.get-tag-name.outputs.result }} + # edxops/ecommerce-prod:${{ github.sha }} # platforms: linux/amd64,linux/arm64