openwrt / docker

Docker containers of the ImageBuilder and SDK
GNU General Public License v2.0
463 stars 76 forks source link

Fix multiarch rootfs containers being mislabelled as AMD64. #113

Closed bwoodsend closed 1 year ago

bwoodsend commented 1 year ago

Fixes #112.

bwoodsend commented 1 year ago

Looks like this also closes #88.

brvphoenix commented 1 year ago

This is the issue of the docker you use (explained in https://github.com/openwrt/packages/pull/20914). The rootfs of malta/be has been used since https://github.com/openwrt/packages/pull/20914. There is no reason to disable it.

bwoodsend commented 1 year ago

Hmm, you're right. It can be used - albeit with some difficulty.

On my local machine running Arch Linux, I already use qemu-user-static and binfmt-support/update-binfmts doesn't exist so that was a bit of a dead end for me. The only way I can get it working locally is to write my own binfmt definition to overwrite the default /usr/lib/binfmt.d/qemu-mips-static.conf provided by the qemu-user-static-binfmt package.

echo ':qemu-mips:M::\x7fELF\x01\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x03\x00\x08:\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff:/usr/bin/qemu-mips-static:FP' > /etc/binfmt.d/qemu-mips-static.conf
systemctl restart systemd-binfmt.service

I'll have a go at swapping out the uses: docker/setup-qemu-action@v2 in this PR for something like what you did (although I'm rather conscious that docker/setup-qemu-action is the official Docker-recommended way of doing it so you'd expect it to work).

brvphoenix commented 1 year ago

binfmt-support/update-binfmts doesn't exist

It is for debian-based system only. For archlinux, run like this directly. https://github.com/multiarch/qemu-user-static/blob/b2b6d871dabaf5cf53fcb9da7c8e695b2279bf81/containers/latest/register.sh#L23

bwoodsend commented 1 year ago

@aparcar and/or @brvphoenix Anything else you need me to do here?

aparcar commented 1 year ago

Excellent!