build,docker: add support for riscv64
Jorropo committed
Dec 29, 2023 at 04:10 UTC
765cffe6c2b7d0a9d757bbdb476cc0ea15fd287c
2 files changed
+15
-1
.github/workflows/docker-image.yml
+14
-1
@@ -107,18 +107,31 @@ jobs:
107
cache-from: type=local,src=/tmp/.buildx-cache
108
cache-to: type=local,dest=/tmp/.buildx-cache-new
109
110
+ - name: Build Docker image (linux/riscv64)
111
+ uses: docker/build-push-action@v4
112
+ with:
113
+ platforms: linux/riscv64
114
+ context: .
115
+ push: false
116
+ load: true
117
+ file: ./Dockerfile
118
+ tags: ${{ env.IMAGE_NAME }}:linux-riscv64
119
+ cache-from: type=local,src=/tmp/.buildx-cache
120
+ cache-to: type=local,dest=/tmp/.buildx-cache-new
121
+
122
# We test all the images on amd64 host here. This uses QEMU to emulate
123
# the other platforms.
124
- run: docker run --rm $IMAGE_NAME:linux-amd64 --version
125
- run: docker run --rm $IMAGE_NAME:linux-arm-v7 --version
126
- run: docker run --rm $IMAGE_NAME:linux-arm64-v8 --version
127
+ - run: docker run --rm $IMAGE_NAME:linux-riscv64 --version
128
129
# This will only push the previously built images.
130
- if: github.event_name != 'workflow_dispatch' || github.event.inputs.push == 'true'
131
name: Publish to Docker Hub
132
uses: docker/build-push-action@v4
133
with:
121
- platforms: linux/amd64,linux/arm/v7,linux/arm64/v8
134
+ platforms: linux/amd64,linux/arm/v7,linux/arm64/v8,linux/riscv64
135
context: .
136
push: true
137
file: ./Dockerfile
mk/util.mk
+1
@@ -16,6 +16,7 @@ SUPPORTED_PLATFORMS += linux-arm
16
SUPPORTED_PLATFORMS += linux-arm64
17
SUPPORTED_PLATFORMS += linux-386
18
SUPPORTED_PLATFORMS += linux-amd64
19
+SUPPORTED_PLATFORMS += linux-riscv64
20
21
SUPPORTED_PLATFORMS += darwin-amd64
22
ifeq ($(shell bin/check_go_version "1.16.0" 2>/dev/null; echo $$?),0)