Skip to content

Commit

Permalink
CI: Fix Docker multi-platform builds
Browse files Browse the repository at this point in the history
Docker now seems to require specifying the platform for ARM. But add it
for 386 too to make configuration generic.

JFYI, local list of platforms:

  docker buildx inspect --bootstrap

Platforms for the image(s):

  docker buildx imagetools inspect ubuntu:bionic

Fixes: #356
Signed-off-by: Vitaly Chikunov <[email protected]>
  • Loading branch information
vt-alt authored and solardiz committed Oct 19, 2024
1 parent 0c28110 commit 3a24203
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
5 changes: 4 additions & 1 deletion .github/workflows/cross.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,13 @@ jobs:
matrix:
include:
- image: arm64v8/ubuntu:jammy
platform: linux/arm64
packages: libelf-dev linux-headers-generic
- image: arm32v7/alt:latest
platform: linux/arm/v7
packages: elfutils kernel-headers-modules-std-def
- image: i386/ubuntu:bionic
platform: linux/386
packages: libelf-dev linux-headers-generic
steps:
- uses: docker/setup-qemu-action@v2
Expand All @@ -44,6 +47,6 @@ jobs:
RUN make -j\$(nproc) KERNELRELEASE=\$(cd /lib/modules; ls)
RUN file lkrg.ko
EOF
- run: docker build .
- run: docker build --platform=${{ matrix.platform }} .

# vim: sw=4
3 changes: 2 additions & 1 deletion .github/workflows/docker-boot.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
PATH=$PATH:/sbin

image=ubuntu:jammy
platform=linux/amd64
qemu=qemu-system-x86_64
opts="-bios bios.bin"
console=ttyS0
Expand All @@ -23,7 +24,7 @@ td=$(mktemp -d)
# Generate system and build in the Docker.
docker build --tag test -f - . <<EOF
# bionic is the latest Ubuntu with i386 support.
FROM $image
FROM --platform=$platform $image
ENV DEBIAN_FRONTEND="noninteractive"
RUN apt-get update -y && \
apt-get install -y \
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/docker-boot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ jobs:
# install: qemu-system-x86

- args: image=arm64v8/ubuntu:jammy
platform=linux/arm64
opts="-M virt,gic-version=3 -cpu cortex-a57"
console=ttyAMA0
root=/dev/vda
Expand All @@ -22,6 +23,7 @@ jobs:
# It's possible to use: opts="-M raspi2b" dtb=bcm2709-rpi-2-b.dtb root=/dev/mmcblk0
# but since power-off is unreliable anyway (until QEMU 6.2) use simpler virt machine.
- args: image=arm32v7/ubuntu:jammy
platform=linux/arm/v7
opts="-M virt"
console=ttyAMA0
root=/dev/vda
Expand Down

0 comments on commit 3a24203

Please sign in to comment.