Skip to content

Commit 6dfd2c0

Browse files
committed
Fix docker cross build
1 parent 3a1d2d9 commit 6dfd2c0

File tree

3 files changed

+7
-6
lines changed

3 files changed

+7
-6
lines changed

.github/workflows/build_debian.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,15 @@ jobs:
1414
fail-fast: false
1515
matrix:
1616
version: [11, 12]
17-
arch: [ "arm32v7", "arm64v8", "amd64", "mips64le", "s390x", "ppc64le"]
17+
arch: [ "armhf.arm32v7", "arm64.arm64v8", "amd64.amd64", "mips64le.mips64le", "s390x.s390x", "ppc64le.ppc64le"]
1818

1919
steps:
2020
- name: Checkout repository
2121
uses: actions/checkout@v4
2222
- name: build package
2323
run: |
2424
curl -s -L https://github.com/svpcom/wfb-ng/releases/download/wifibroadcast-17.10/qemu-7.2.13-fixed.tar.gz | sudo tar xzv -C /
25-
make deb_docker DOCKER_SRC_IMAGE=${{ matrix.arch }}/debian:${{ matrix.version }}
25+
make deb_docker DOCKER_ARCH=$(echo ${{ matrix.arch}} | cut -f1 -d.) DOCKER_SRC_IMAGE=$(echo ${{ matrix.arch }} | cut -f2 -d.)/debian:${{ matrix.version }}
2626
- name: Archive production artifacts
2727
uses: actions/upload-artifact@v4
2828
id: artifact-upload-step

.github/workflows/build_ubuntu.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,15 @@ jobs:
1414
fail-fast: false
1515
matrix:
1616
version: [ "20.04", "22.04", "24.04" ]
17-
arch: [ "arm32v7", "arm64v8", "amd64"]
17+
arch: [ "armhf.arm32v7", "arm64.arm64v8", "amd64.amd64"]
1818

1919
steps:
2020
- name: Checkout repository
2121
uses: actions/checkout@v4
2222
- name: build package
2323
run: |
2424
curl -s -L https://github.com/svpcom/wfb-ng/releases/download/wifibroadcast-17.10/qemu-7.2.13-fixed.tar.gz | sudo tar xzv -C /
25-
make deb_docker DOCKER_SRC_IMAGE=${{ matrix.arch }}/ubuntu:${{ matrix.version }}
25+
make deb_docker DOCKER_ARCH=$(echo ${{ matrix.arch}} | cut -f1 -d.) DOCKER_SRC_IMAGE=$(echo ${{ matrix.arch }} | cut -f2 -d.)/ubuntu:${{ matrix.version }}
2626
- name: Archive production artifacts
2727
uses: actions/upload-artifact@v4
2828
id: artifact-upload-step

Makefile

+3-2
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ else
1212
endif
1313

1414
ENV ?= $(PWD)/env
15+
DOCKER_ARCH ?= amd64
1516
DOCKER_SRC_IMAGE ?= "p2ptech/cross-build:2023-02-21-raspios-bullseye-armhf-lite"
1617
STDEB ?= "git+https://github.com/svpcom/stdeb"
1718

@@ -86,6 +87,6 @@ deb_docker: /opt/qemu/bin
8687
@if ! [ -d /opt/qemu ]; then echo "Docker cross build requires patched QEMU!\nApply ./scripts/qemu/qemu.patch to qemu-7.2.0 and build it:\n ./configure --prefix=/opt/qemu --static --disable-system && make && sudo make install"; exit 1; fi
8788
if ! ls /proc/sys/fs/binfmt_misc | grep -q qemu ; then sudo ./scripts/qemu/qemu-binfmt-conf.sh --qemu-path /opt/qemu/bin --persistent yes; fi
8889
cp -a Makefile docker/src/
89-
TAG="wfb-ng:build-`date +%s`"; docker build -t $$TAG docker --build-arg SRC_IMAGE=$(DOCKER_SRC_IMAGE) && \
90-
docker run -i --rm -v $(PWD):/build $$TAG bash -c "trap 'chown -R --reference=. .' EXIT; export VERSION=$(VERSION) COMMIT=$(COMMIT) SOURCE_DATE_EPOCH=$(SOURCE_DATE_EPOCH) && cd /build && make clean && make test && make deb"
90+
TAG="wfb-ng:build-`date +%s`"; docker build --platform linux/$(DOCKER_ARCH) -t $$TAG docker --build-arg SRC_IMAGE=$(DOCKER_SRC_IMAGE) && \
91+
docker run --platform linux/$(DOCKER_ARCH) -i --rm -v $(PWD):/build $$TAG bash -c "trap 'chown -R --reference=. .' EXIT; export VERSION=$(VERSION) COMMIT=$(COMMIT) SOURCE_DATE_EPOCH=$(SOURCE_DATE_EPOCH) && cd /build && make clean && make test && make deb"
9192
docker image ls -q "wfb-ng:build-*" | uniq | tail -n+6 | while read i ; do docker rmi -f $$i; done

0 commit comments

Comments
 (0)