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

Docker images are not multi-architecture #2780

Open
DomAmato opened this issue Jul 10, 2019 · 8 comments
Open

Docker images are not multi-architecture #2780

DomAmato opened this issue Jul 10, 2019 · 8 comments

Comments

@DomAmato
Copy link

@DomAmato DomAmato commented Jul 10, 2019

Issue type


  • Feature request.

Defect/Feature description

How to reproduce issue

Trying to use the docker image for freeradius on a raspberry pi leads to errors during build time:

exec user process caused "exec format error"

building the image locally fixed this issue.

There are multiple ways of creating multi-arch images and I am not sure how the current build gets deployed to docker hub. I have had success using dockers buildx cli extension

@mcnewton
Copy link
Member

@mcnewton mcnewton commented Nov 15, 2019

Thanks for the info. This is pretty low priority; it's easy enough to build the docker images on any system yourself. Current images are built on an x86 system with commands in the Makefile - see make docker. Patches welcome... though I'll try and look at it at some point if I have time.

@shivamb
Copy link

@shivamb shivamb commented Jul 25, 2020

I would love to see this fix.

@flisboac
Copy link

@flisboac flisboac commented May 12, 2021

@mcnewton an official image would still add a ton of value. Most ARM users (which is now rather common) won't customize the image in any way, so not having a build at ready would be an unnecessary barrier to adoption. I don't think this is "pretty low" in priority. Perhaps medium; or low, at most. But again, I lack the vision of the bigger picture in the project.

How would you estimate the effort to add support for ARM builds? Would it be possible to add CI infrastructure to build ARM images (perhaps with QEMU/etc, or buildx?)

@mcnewton
Copy link
Member

@mcnewton mcnewton commented May 12, 2021

Sure if you've got some magic to take all the high and medium items off our to-do lists, then this will jump up from being low priority. Otherwise, it stays where it is. I'm not disputing whether it's useful or not.

I have no estimate on the effort involved, as I've not looked at it.

As always, pull requests welcome.

@arr2036
Copy link
Member

@arr2036 arr2036 commented May 13, 2021

Agreed. This would be a relatively easy one for an external contributor to tackle. I'd be great to have a CI task that built a version of the server for ARM under qemu and tested it... Even better if we could cross-compile and then test under an emulator.

@flisboac
Copy link

@flisboac flisboac commented May 13, 2021

First of all, I'm sorry for my initial message.

I took a very quick look into this yesterday. The build system is quite complex, but I think I have a vague idea on how to make it work by using buildx. I cloned the project and made some changes, but I didn't have the time to test the build again. I also don't know yet if the changes I made would break any automated CI pipelines the project may have. In fact, I don't know anything about this project's CI pipelines at all.

My idea was to change the crossbuild rule dependencies around, in scripts/docker/crossbuild/crossbuild.mk, to add a single dependency to a new target crossbuild.${1}.push, which would depend on crossbuild.${1} and then push the native (tested) image along with additional ARM builds (by using docker buildx build --push). Problem is that this approach doesn't test the ARM images themselves, I guess.

Unfortunately, I had to stop before I could test these changes in a proper x64 Linux host. I don't have too much time now, but perhaps this weekend I can see into this issue. If it's okay, I can commit what I have changed and open a PR, just for the sake of getting early feedback.

@mcnewton
Copy link
Member

@mcnewton mcnewton commented May 13, 2021

@flisboac thanks for taking a look! Don't worry about crossbuild, that's more for developers to check different platforms, it's not used for the official Docker builds.

Docker builds are done by scripts/docker/docker.mk, and the Dockerfiles used by the "official" docker images are in scripts/docker/ubuntu18/ and scripts/docker/alpine. There are Dockerfiles there for other platforms as well, but they're not built and uploaded to Dockerhub, but they should be kept in sync if any of the others are changed (which I think is unlikely anyway).

I don't know how the alternative arch builds work at all (I've never looked at buildx) but if it's a simple command to run then I would imagine that it's quite easy to add into docker.mk. There's only a handful of targets there.

@Vinigas
Copy link

@Vinigas Vinigas commented Aug 25, 2021

arm64 dockerhub tag would be useful for RaspberryPi4-Docker machines.

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

Successfully merging a pull request may close this issue.

None yet
6 participants