jboss-dockerfiles / wildfly

Docker image for WildFly project
https://quay.io/repository/wildfly/wildfly
MIT License
280 stars 237 forks source link

Create arm64 Images #155

Closed t1 closed 1 year ago

t1 commented 2 years ago

For all Raspberry Pie ARM and MacBook Pro M1/Pro/Max users, it would be very nice to have these images not only for linux/amd64, but also at least for linux/arm64. This cascades down to the base CentOS, which is available for even more achitectures.

It would be also possible to support Windows as OS, but I guess that would be a separate issue.

t1 commented 2 years ago

I'm not sure if this is actually being built with GitHub Actions or not, as there's already some setup for buildx but also a cccp.yml file. This works for me:

docker buildx build --push --platform linux/arm64,linux/amd64 -t <owner>/wildfly .

amoscatelli commented 2 years ago

We are moving our architecture to arm64 and we also need this. Any plans for arm64?

amoscatelli commented 2 years ago

@t1 I don't understand, how can you build wildfly image for arm64 ? Wildfly Dockerfile is based on jboss/base-jdk:11 which is not arm64 compatible.

Thank you

t1 commented 2 years ago

This propagates from jboss/wildflyjboss/base-jdkjboss/basecentos:7, which is finally available also for arm64.

amoscatelli commented 2 years ago

@t1 I spent some hour trying to figure out how to make this work on arm64 machine.

I cloned https://github.com/jboss-dockerfiles/wildfly.git. I ran 'docker buildx build --push --platform linux/arm64 -t visiontechcloud/wildfly .' inside the folder. The image is public/published here : https://hub.docker.com/r/visiontechcloud/wildfly

image

Then I tried a simple 'docker run visiontechcloud/wildfly' on an aarch64 (aarch64 = arm64 afaik) machine and I got this error service_1 | standard_init_linux.go:228: exec user process caused: exec format error

Feels like I misenderstood something important. This kind of errors usually happen when a non arm image is run on arm64 architecture.

t1 commented 2 years ago

That works on my M1, but it's kinda slow. I have no idea what the cause of your problem could be.

FYI: I build by own images and publish them as https://hub.docker.com/repository/docker/rdohna/wildfly It would be just very nice if the 'official' wildfly images where multi-arch.

amoscatelli commented 2 years ago

The compressed image is different also. I am really doing something wrong ... I am going to test your images. Also, I am running the 'docker buildx build' command on windows. Are you building on Linux ?

amoscatelli commented 2 years ago

Also your Dockerfile is also different : https://github.com/t1/rdohna-wildfly-docker-image/blob/master/Dockerfile

Mine is the original from : https://github.com/jboss-dockerfiles/wildfly/blob/master/Dockerfile

t1 commented 2 years ago

I'm building on a M1 Mac. That's why I need arm images. My build is completely different, yes. I currently add variants that include the GraphQL feature pack.

amoscatelli commented 2 years ago

So you are building directly on ARM Machine, I am trying to build from x64 for Arm64 ... I thought that I could do that with buildx. I am going to try and compile directly from an ARM Machine too then.

t1 commented 2 years ago

I build x64 images from my arm machine, so it should go the other way around, too. But I haven't tried that.

t1 commented 2 years ago

BTW: I also build the images via GitHub Actions, and they seem to run x64... works just fine, too.

krisgerhard commented 2 years ago

I've created a PR https://github.com/jboss-dockerfiles/wildfly/pull/157 to build arm64 image in addition to amd64. ARM64 images need to be built for base and base-jdk as well though which are not maintained through GitHub Actions so I have no way to influence those.

krisgerhard commented 2 years ago

In the meantime you can use the images we built for ourselves.

Available platforms: linux/arm64 linux/amd64 Wildfly (last 9 releases): https://hub.docker.com/r/cybexer/wildfly/tags Base-jdk (all tags): https://hub.docker.com/r/cybexer/base-jdk/tags Base (all tags): https://hub.docker.com/r/cybexer/base/tags

amoscatelli commented 2 years ago

Thank you. Anyway we hope to get soon official images to migrate also Keycloak images to arm64.

krisgerhard commented 2 years ago

🤞

jmesnil commented 1 year ago

thanks to @krisgerhard, we now have linux/arm64 image starting with quay.io/wildfly/wildfly:26.1.1.Final-2.

krisgerhard commented 1 year ago

I've created a PR #157 to build arm64 image in addition to amd64. ARM64 images need to be built for base and base-jdk as well though which are not maintained through GitHub Actions so I have no way to influence those.

@jmesnil Thank you for merging. Unfortunately this is only one piece of the puzzle. Underlying images base and base-jdk also need to be built for ARM64. Can you elevate this issue?

jmesnil commented 1 year ago

@krisgerhard oh, sorry, I thought the base images were already supporting the arm64 architecture but that were your forks...

I'll check what can be done with the base-jdk images. I also wonder if that's not the right opportunity to switch to the official openjdk images that are more often updated....

jmesnil commented 1 year ago

arm64 supported in base-jdk tracked by https://github.com/jboss-dockerfiles/base-jdk/issues/19

amoscatelli commented 1 year ago

@krisgerhard maybe you could make a PR from your fork also for base-jdk ?

thank you in advance

krisgerhard commented 1 year ago

@krisgerhard maybe you could make a PR from your fork also for base-jdk ?

thank you in advance

Underlying images are not built via Github Actions unfortunately.

amoscatelli commented 1 year ago

Oh, I see. I hope we get lucky 😢

krisgerhard commented 1 year ago

I would welcome merging https://github.com/jboss-dockerfiles/wildfly/pull/161. It uses base image which supports both arm and amd architectures.

jmesnil commented 1 year ago

I'm closing this as it has been fixed by https://github.com/jboss-dockerfiles/wildfly/pull/161