-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathbuildx-out-riscv64.sh
51 lines (43 loc) · 1.57 KB
/
buildx-out-riscv64.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#!/bin/bash
# Install buildx
# Post https://devdotnet.org/post/sborka-docker-konteinerov-dlya-arm-arhitekturi-ispolzuya-buildx/
# $ chmod +x buildx-out-riscv64.sh
# $ ./buildx-out-riscv64.sh
set -e
echo "Start BUILDX"
# RISC-V (riscv64)
#libgpiod: 1.6.3, 1.6.4, 2.0.2, 2.1.2
#:riscv64/ubuntu 20.04, 22.04,
#:riscv64/debian sid
#:riscv64/alpine edge
for LIB_VERSION in 1.6.3 1.6.4 2.0.2 2.1.2
do
# ubuntu, debian
for IMAGE_VERSION in riscv64/ubuntu:20.04 riscv64/ubuntu:22.04 riscv64/debian:sid
do
#
declare IMAGE_VERSION_2=$(echo "$IMAGE_VERSION" | tr : -)
IMAGE_VERSION_2=$(echo "$IMAGE_VERSION_2" | tr / -)
# build
echo "BUILD version: ${LIB_VERSION} image: ${IMAGE_VERSION}"
docker buildx build --platform linux/riscv64 -f Dockerfile.ubuntu \
--build-arg LIB_VERSION=${LIB_VERSION} --build-arg IMAGE_VERSION=${IMAGE_VERSION} \
--target=artifact --output type=local,dest=out/ -t devdotnetorg/libgpiod:${LIB_VERSION}-${IMAGE_VERSION_2} .
#
done
# alpine
for IMAGE_VERSION in riscv64/alpine:edge
do
#
declare IMAGE_VERSION_2=$(echo "$IMAGE_VERSION" | tr : -)
IMAGE_VERSION_2=$(echo "$IMAGE_VERSION_2" | tr / -)
# build
echo "BUILD version: ${LIB_VERSION} image: ${IMAGE_VERSION}"
# --platform linux/arm,linux/arm64,linux/amd64
docker buildx build --platform linux/riscv64 -f Dockerfile.alpine \
--build-arg LIB_VERSION=${LIB_VERSION} --build-arg IMAGE_VERSION=${IMAGE_VERSION} \
--target=artifact --output type=local,dest=out/ -t devdotnetorg/libgpiod:${LIB_VERSION}-${IMAGE_VERSION_2} .
#
done
done
echo "BUILDX END"