diff --git a/.github/workflows/build-and-push-whisper.yml b/.github/workflows/build-and-push-whisper.yml index d07681c..a42674e 100644 --- a/.github/workflows/build-and-push-whisper.yml +++ b/.github/workflows/build-and-push-whisper.yml @@ -16,11 +16,21 @@ jobs: permissions: contents: read packages: write - + + strategy: + matrix: + include: + - targetarch: amd64 + platform: amd64 + - targetarch: arm64v8 + platform: arm64 steps: - name: Checkout repository uses: actions/checkout@v3 + - name: Set up QEMU + uses: docker/setup-qemu-action@v1 + - name: Set up Docker Buildx uses: docker/setup-buildx-action@v2 @@ -36,7 +46,10 @@ jobs: with: context: . file: docker/whisper.dockerfile - tags: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest - push: true - cache-from: type=registry,ref=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} - cache-to: type=inline \ No newline at end of file + tags: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ matrix.targetarch }} + build-args: | + TARGETARCH=${{ matrix.targetarch }} + platforms: linux/${{ matrix.platform }} + push: false + # cache-from: type=registry,ref=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ matrix.targetarch }} + # cache-to: type=inline diff --git a/docker/whisper.dockerfile b/docker/whisper.dockerfile index baa1981..b45bd0e 100644 --- a/docker/whisper.dockerfile +++ b/docker/whisper.dockerfile @@ -1,4 +1,6 @@ -FROM ubuntu:20.04 as builder +ARG TARGETARCH=amd64 + +FROM $TARGETARCH/ubuntu:20.04 as builder RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \ && apt-get -y install \ @@ -16,5 +18,5 @@ RUN cd /SweRV-ISS \ && mkdir -p /opt/SweRV-ISS \ && make install INSTALL_DIR=/opt/SweRV-ISS -FROM ubuntu:20.04 +FROM $TARGETARCH/ubuntu:20.04 COPY --from=builder /opt/SweRV-ISS /opt/SweRV-ISS