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

Cannot produce a Linux executable #23676

Closed
AndreasMaita opened this issue Feb 14, 2022 · 4 comments
Closed

Cannot produce a Linux executable #23676

AndreasMaita opened this issue Feb 14, 2022 · 4 comments
Labels
area/native-image kind/bug Something isn't working

Comments

@AndreasMaita
Copy link

AndreasMaita commented Feb 14, 2022

Dear Community,

I'm new to Quarkus, and I am trying to follow along the getting-started guides. My goal is to build a Linux executable, so I can run it inside a docker container.

I'm running a Debian Linux Machine on my MacBook Pro M1, since I have read that there are issues compiling native executables on Android Silicon Chips.

Here is an overview of my machine's architecture:
image

I installed the GraalVM and Java, as recommended by the GraalVM getting started website. Here is a Screenshot of my environment Variables:
image
image

Also Docker is running without Issues on my Machine:
image

I know that i can use the mvn wrapper to execute mvn goals, I installed it anyways:
image

Here is the Issue. When I'm trying to build a native image with:

mvn package -Dnative

Everything works fine and I get my *runnable.

However when i try to build a general linux image with this command

mvn package -Dquarkus.native.container-build=true

i get following output:
image

I have googled for days now and can't find a solution. Can someone tell me what im doing wrong?

Thanks so much in advance!

@famod
Copy link
Member

famod commented Feb 15, 2022

I suppose you have googled something like MacBook Pro M1 docker "exec format error"?

@AndreasMaita
Copy link
Author

I suppose you have googled something like MacBook Pro M1 docker "exec format error"?

Yes, and went down the deep rabbithole that comes with it. I have tried every single solution out there. However, This issue is not about the M1, since i already created a VM that runs Linux Debian, which should have the known chip architecture.

@lucifer4j
Copy link
Contributor

Hi!

When using -Dquarkus.native.container-build=true, a docker image is downloaded in which the native executable is built. As you can see from the logs, its quay.io/quarkus/ubi-quarkus-native-image in this case and its a x86_64 image. The error you see

WARNING: The requested image's platform (linux/amd64) does not match the detected host platform (linux/arm64/v8) and no specific platform was requested

results from running a x86_64 container on an arm host.

Further, it seems there is no ARM variant available for this image. quarkusio/quarkus-images#83 is probably the right issue to track this development. One of the comments on that issue also links to a blogpost showing how to use a custom ARM image for this purpose.

@AndreasMaita
Copy link
Author

Thank you very much for your input. I will take a look at this other issue!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/native-image kind/bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants