From 397f47dec6e4d50d56e67d608565a748dcfdbf23 Mon Sep 17 00:00:00 2001 From: Alan Raju <94040192+alanraju-aot@users.noreply.github.com> Date: Thu, 5 Dec 2024 02:45:07 -0800 Subject: [PATCH] feature/FWF-3694 Updated CD action to Build and push Multiarch images into Docker registry (#2405) --- .github/workflows/forms-flow-documents-cd.yml | 42 +++++++++---------- forms-flow-documents/Dockerfile-ARM64 | 2 +- 2 files changed, 20 insertions(+), 24 deletions(-) diff --git a/.github/workflows/forms-flow-documents-cd.yml b/.github/workflows/forms-flow-documents-cd.yml index 88303e0358..4c2942f504 100644 --- a/.github/workflows/forms-flow-documents-cd.yml +++ b/.github/workflows/forms-flow-documents-cd.yml @@ -78,31 +78,27 @@ jobs: - name: Build and push Docker image if: ${{ github.ref != 'refs/heads/master' }} - uses: docker/build-push-action@v4 - with: - context: forms-flow-documents - push: true - platforms: linux/amd64 - tags: ${{ steps.meta.outputs.tags }} - labels: ${{ steps.meta.outputs.labels }} + run: | + docker buildx create --name mybuilder --use + cd ./forms-flow-documents + docker buildx build \ + --platform linux/amd64,linux/arm64 \ + --file Dockerfile \ + --file Dockerfile-ARM64 \ + --tags: ${{ steps.meta.outputs.tags }} + --labels: ${{ steps.meta.outputs.labels }} - name: Build and push Docker image if: ${{ github.ref == 'refs/heads/master' }} - uses: docker/build-push-action@v4 - with: - context: forms-flow-documents - push: true - platforms: linux/amd64 - tags: ${{ steps.meta.outputs.tags }}, formsflow/forms-flow-documents-api:latest - labels: ${{ steps.meta.outputs.labels }} - - name: Build and push Docker image - arm64 - uses: docker/build-push-action@v4 - with: - context: forms-flow-documents - file: forms-flow-documents/Dockerfile-ARM64 - push: true - platforms: linux/arm64/v8 - tags: ${{ steps.meta.outputs.tags }}-arm64 - labels: ${{ steps.meta.outputs.labels }} + run: | + docker buildx create --name mybuilder --use + cd ./forms-flow-documents + docker buildx build \ + --platform linux/amd64,linux/arm64 \ + --file Dockerfile \ + --file Dockerfile-ARM64 \ + --tags: ${{ steps.meta.outputs.tags }}, formsflow/forms-flow-documents-api:latest + --labels: ${{ steps.meta.outputs.labels }} + - name: Scan Docker image 🐳 uses: snyk/actions/docker@master continue-on-error: true diff --git a/forms-flow-documents/Dockerfile-ARM64 b/forms-flow-documents/Dockerfile-ARM64 index 163ff69db3..ed605fe324 100644 --- a/forms-flow-documents/Dockerfile-ARM64 +++ b/forms-flow-documents/Dockerfile-ARM64 @@ -1,5 +1,5 @@ #Author: Kurian Benoy -FROM python:python:3.12.6-slim +FROM python:3.12.6-slim WORKDIR /forms-flow-documents/app