From 765cffe6c2b7d0a9d757bbdb476cc0ea15fd287c Mon Sep 17 00:00:00 2001
From: Jorropo <jorropo.pgm@gmail.com>
Date: Fri, 29 Dec 2023 04:10:27 +0100
Subject: [PATCH] build,docker: add support for riscv64

---
 .github/workflows/docker-image.yml | 15 ++++++++++++++-
 mk/util.mk                         |  1 +
 2 files changed, 15 insertions(+), 1 deletion(-)

diff --git a/.github/workflows/docker-image.yml b/.github/workflows/docker-image.yml
index c1e77112d..826bfad85 100644
--- a/.github/workflows/docker-image.yml
+++ b/.github/workflows/docker-image.yml
@@ -107,18 +107,31 @@ jobs:
           cache-from: type=local,src=/tmp/.buildx-cache
           cache-to: type=local,dest=/tmp/.buildx-cache-new
 
+      - name: Build Docker image (linux/riscv64)
+        uses: docker/build-push-action@v4
+        with:
+          platforms: linux/riscv64
+          context: .
+          push: false
+          load: true
+          file: ./Dockerfile
+          tags: ${{ env.IMAGE_NAME }}:linux-riscv64
+          cache-from: type=local,src=/tmp/.buildx-cache
+          cache-to: type=local,dest=/tmp/.buildx-cache-new
+
       # We test all the images on amd64 host here. This uses QEMU to emulate
       # the other platforms.
       - run: docker run --rm $IMAGE_NAME:linux-amd64 --version
       - run: docker run --rm $IMAGE_NAME:linux-arm-v7 --version
       - run: docker run --rm $IMAGE_NAME:linux-arm64-v8 --version
+      - run: docker run --rm $IMAGE_NAME:linux-riscv64 --version
 
       # This will only push the previously built images.
       - if: github.event_name != 'workflow_dispatch' || github.event.inputs.push == 'true'
         name: Publish to Docker Hub
         uses: docker/build-push-action@v4
         with:
-          platforms: linux/amd64,linux/arm/v7,linux/arm64/v8
+          platforms: linux/amd64,linux/arm/v7,linux/arm64/v8,linux/riscv64
           context: .
           push: true
           file: ./Dockerfile
diff --git a/mk/util.mk b/mk/util.mk
index 2ce48583f..50040c17a 100644
--- a/mk/util.mk
+++ b/mk/util.mk
@@ -16,6 +16,7 @@ SUPPORTED_PLATFORMS += linux-arm
 SUPPORTED_PLATFORMS += linux-arm64
 SUPPORTED_PLATFORMS += linux-386
 SUPPORTED_PLATFORMS += linux-amd64
+SUPPORTED_PLATFORMS += linux-riscv64
 
 SUPPORTED_PLATFORMS += darwin-amd64
 ifeq ($(shell bin/check_go_version "1.16.0" 2>/dev/null; echo $$?),0)
-- 
GitLab