Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable cross-architecture builds #99

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

d2r4
Copy link

@d2r4 d2r4 commented Jul 14, 2022

Using multiarch/qemu-user-static allows for many cross-architecture build scenarios. In this case looking to enable builds of the arm32v7 and arm64v8 images on common amd64 platforms such as docker hubs build infrastructure.

@adamradocz
Copy link
Member

The docker hub doesn't build the images for free for open-source projects anymore, so I don't know how this PR will help us build ARM images.

Is there a way to modify the https://github.com/BOINC/boinc-client-docker/blob/master/update.sh file in order to do that on any local machine?

@d2r4
Copy link
Author

d2r4 commented Jul 18, 2022

Yes, this can be added to update.sh. Though I am not sure yet how to clean-up afterwards. Once qemu-user-static runs the effects seem to stick around until reboot.

@adamradocz
Copy link
Member

Got this error:

root@Development:~/boinc-client-docker# docker run --rm --privileged multiarch/qemu-user-static --reset -p yes
Unable to find image 'multiarch/qemu-user-static:latest' locally
latest: Pulling from multiarch/qemu-user-static
19d511225f94: Pull complete 
6a33d6a40b9b: Pull complete 
30abb83a18eb: Pull complete 
0657daef200b: Pull complete 
32680003bcd0: Pull complete 
Digest: sha256:0803de73e3799a381acdd48f73516046f066a7bc121ed000d447f65276758a3c
Status: Downloaded newer image for multiarch/qemu-user-static:latest
mount: permission denied (are you root?)
mount: permission denied (are you root?)

@d2r4
Copy link
Author

d2r4 commented Aug 13, 2022

Running that command in a fresh install of Ubuntu 22.04 LTS, Docker 20.10.17. I am not receiving an error. Can you provide some info about your build environment so I can attempt to reproduce this issue?

d2r4@d2r4-VirtualBox:~$ sudo docker run --rm --privileged multiarch/qemu-user-static --reset -p yes
Unable to find image 'multiarch/qemu-user-static:latest' locally
latest: Pulling from multiarch/qemu-user-static
19d511225f94: Pull complete 
6a33d6a40b9b: Pull complete 
30abb83a18eb: Pull complete 
0657daef200b: Pull complete 
32680003bcd0: Pull complete 
Digest: sha256:0803de73e3799a381acdd48f73516046f066a7bc121ed000d447f65276758a3c
Status: Downloaded newer image for multiarch/qemu-user-static:latest
Setting /usr/bin/qemu-alpha-static as binfmt interpreter for alpha
Setting /usr/bin/qemu-arm-static as binfmt interpreter for arm
Setting /usr/bin/qemu-armeb-static as binfmt interpreter for armeb
Setting /usr/bin/qemu-sparc-static as binfmt interpreter for sparc
Setting /usr/bin/qemu-sparc32plus-static as binfmt interpreter for sparc32plus
Setting /usr/bin/qemu-sparc64-static as binfmt interpreter for sparc64
Setting /usr/bin/qemu-ppc-static as binfmt interpreter for ppc
Setting /usr/bin/qemu-ppc64-static as binfmt interpreter for ppc64
Setting /usr/bin/qemu-ppc64le-static as binfmt interpreter for ppc64le
Setting /usr/bin/qemu-m68k-static as binfmt interpreter for m68k
Setting /usr/bin/qemu-mips-static as binfmt interpreter for mips
Setting /usr/bin/qemu-mipsel-static as binfmt interpreter for mipsel
Setting /usr/bin/qemu-mipsn32-static as binfmt interpreter for mipsn32
Setting /usr/bin/qemu-mipsn32el-static as binfmt interpreter for mipsn32el
Setting /usr/bin/qemu-mips64-static as binfmt interpreter for mips64
Setting /usr/bin/qemu-mips64el-static as binfmt interpreter for mips64el
Setting /usr/bin/qemu-sh4-static as binfmt interpreter for sh4
Setting /usr/bin/qemu-sh4eb-static as binfmt interpreter for sh4eb
Setting /usr/bin/qemu-s390x-static as binfmt interpreter for s390x
Setting /usr/bin/qemu-aarch64-static as binfmt interpreter for aarch64
Setting /usr/bin/qemu-aarch64_be-static as binfmt interpreter for aarch64_be
Setting /usr/bin/qemu-hppa-static as binfmt interpreter for hppa
Setting /usr/bin/qemu-riscv32-static as binfmt interpreter for riscv32
Setting /usr/bin/qemu-riscv64-static as binfmt interpreter for riscv64
Setting /usr/bin/qemu-xtensa-static as binfmt interpreter for xtensa
Setting /usr/bin/qemu-xtensaeb-static as binfmt interpreter for xtensaeb
Setting /usr/bin/qemu-microblaze-static as binfmt interpreter for microblaze
Setting /usr/bin/qemu-microblazeel-static as binfmt interpreter for microblazeel
Setting /usr/bin/qemu-or1k-static as binfmt interpreter for or1k
Setting /usr/bin/qemu-hexagon-static as binfmt interpreter for hexagon

@adamradocz
Copy link
Member

Freshly installed Ubuntu 20.04 on LXC container.

@d2r4
Copy link
Author

d2r4 commented Dec 3, 2022

I setup Ubuntu 20.04.5 LTS hosting a matching privileged LXC container, the container is running docker 20.10.18. In this environment I am still able to run that docker command successfully and don't see the "mount: permission denied (are you root?)" errors. Do you have any other information that could be helpful as to your setup?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants