From 4b3e0385a385918208a12545b50bb570218992e4 Mon Sep 17 00:00:00 2001 From: Anthony ARNAUD Date: Sun, 31 Mar 2024 02:32:49 -0400 Subject: [PATCH] multi-arch docker build --- .github/workflows/docker-image.yml | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/.github/workflows/docker-image.yml b/.github/workflows/docker-image.yml index 17aadb5..2ce712d 100644 --- a/.github/workflows/docker-image.yml +++ b/.github/workflows/docker-image.yml @@ -25,14 +25,18 @@ jobs: steps: - uses: actions/checkout@v3 - - name: Build image - run: docker build . --file Dockerfile --tag $IMAGE_NAME --label "runnumber=${GITHUB_RUN_ID}" + - name: Set up QEMU + uses: docker/setup-qemu-action@v1 + + - name: Set up Docker Buildx + id: buildx + uses: docker/setup-buildx-action@v1 - name: Log in to registry # This is where you will update the PAT to GITHUB_TOKEN run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u $ --password-stdin - - name: Push image + - name: Build and Push container image run: | IMAGE_ID=ghcr.io/${{ github.repository_owner }}/$IMAGE_NAME @@ -46,5 +50,6 @@ jobs: [ "$VERSION" == "master" ] && VERSION=latest echo IMAGE_ID=$IMAGE_ID echo VERSION=$VERSION - docker tag $IMAGE_NAME $IMAGE_ID:$VERSION - docker push $IMAGE_ID:$VERSION \ No newline at end of file + docker buildx build --file Dockerfile --label "runnumber=${GITHUB_RUN_ID}" --push \ + --tag $IMAGE_ID:$VERSION \ + --platform linux/amd64,linux/arm64,linux/armv7 .