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

Issue building docker native image on Windows 11 with maven and micronaut 4.2.0 #913

Closed
leosdanysa opened this issue Nov 30, 2023 · 3 comments
Labels
relates-to: graal type: bug Something isn't working

Comments

@leosdanysa
Copy link

Created project from command line:

  1. mn create-function-app example.micronaut.micronautguide --features=graalvm,aws-lambda --build=maven --lang=java
  2. cd into micronautguide project folder

Run command to build docker native image:
3. ./mvnw package -Dpackaging=docker-native -Dmicronaut.runtime=lambda -Pgraalvm

Got this error:

[INFO] Step 13/22 : RUN native-image @/home/app/graalvm-native-image.args -H:Class=${CLASS_NAME} -H:Name=application -cp "/home/app/libs/*:/home/app/classes/"
[INFO]

[INFO]  ---> Running in 3dff771c25ea

[INFO] Error: Found unrecognized options while parsing argument file '/home/app/graalvm-native-image.args':
example.micronaut.FunctionLambdaRuntime

[ERROR] The command '/bin/sh -c native-image @/home/app/graalvm-native-image.args -H:Class=${CLASS_NAME} -H:Name=application -cp "/home/app/libs/*:/home/app/classes/"' returned a non-zero code: 20
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  7.571 s
[INFO] Finished at: 2023-11-30T18:02:38-03:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal io.micronaut.maven:micronaut-maven-plugin:4.0.7:docker-native (default-docker-native) on project micronautguide: Execution default-docker-native of goal io.micronaut.maven:micronaut-maven-plugin:4.0.7:docker-native failed: Could not build image: The command '/bin/sh -c native-image @/home/app/graalvm-native-image.args -H:Class=${CLASS_NAME} -H:Name=application -cp "/home/app/libs/*:/home/app/classes/"' returned a non-zero code: 20 -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginExecutionException

I tried the same on a different Windows 11 machine, and I got the same result. I tried a gradle version of the project and it worked.

@leosdanysa
Copy link
Author

This is the content for the native-image-*.args file


--no-fallback
-o
C:\\\\Work\\\\Workspaces\\\\workspace_graal\\\\micronautguide\\\\target\\\\micronautguide
--no-fallback
--exclude-config
\Q/home/app/libs/netty-codec-http-4.1.101.Final.jar\E
^/META-INF/native-image/
--exclude-config
\Q/home/app/libs/netty-codec-http2-4.1.101.Final.jar\E
^/META-INF/native-image/
--exclude-config
\Q/home/app/libs/netty-handler-4.1.101.Final.jar\E
^/META-INF/native-image/
--exclude-config
\Q/home/app/libs/netty-common-4.1.101.Final.jar\E
^/META-INF/native-image/
--exclude-config
\Q/home/app/libs/netty-buffer-4.1.101.Final.jar\E
^/META-INF/native-image/
--exclude-config
\Q/home/app/libs/netty-transport-4.1.101.Final.jar\E
^/META-INF/native-image/
example.micronaut.FunctionLambdaRuntime

@sdelamo sdelamo added type: bug Something isn't working relates-to: graal labels Nov 30, 2023
@lbovolini
Copy link

Same here. On Manjaro Linux.

@alvarosanchez
Copy link
Member

This has been fixed by #900

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
relates-to: graal type: bug Something isn't working
Projects
No open projects
Status: Done
Development

No branches or pull requests

4 participants