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

Building a native image with minikube docker fails #7158

Closed
ia3andy opened this issue Feb 12, 2020 · 6 comments
Closed

Building a native image with minikube docker fails #7158

ia3andy opened this issue Feb 12, 2020 · 6 comments
Labels
kind/bug Something isn't working triage/duplicate This issue or pull request already exists

Comments

@ia3andy
Copy link
Contributor

ia3andy commented Feb 12, 2020

Describe the bug
Since I use minikube on my machine, I don't want to switch back and forth with Docker to build my native image which use a lot of resources.

I directly use minikube docker with:

$ eval $(minikube docker-env)  
$ mvn package -Pnative -Dquarkus.native.container-build=true

and it fails with:

[INFO] [io.quarkus.deployment.pkg.steps.NativeImageBuildStep] Running Quarkus native-image plugin on GraalVM Version 19.3.1 CE
[INFO] [io.quarkus.deployment.pkg.steps.NativeImageBuildStep] docker run -v /Users/ia3andy/workspace/redhat/talks/game-of-stacks/arrow/target/gos-arrow-0.0.1-native-image-source-jar:/project:z --rm quay.io/quarkus/ubi-quarkus-native-image:19.3.1-java8 -J-Dsun.nio.ch.maxUpdateArraySize=100 -J-Dvertx.logger-delegate-factory-class-name=io.quarkus.vertx.core.runtime.VertxLogDelegateFactory -J-Dvertx.disableDnsResolver=true -J-Dio.netty.leakDetection.level=DISABLED -J-Dio.netty.allocator.maxOrder=1 -J-Djava.util.logging.manager=org.jboss.logmanager.LogManager -H:ReflectionConfigurationFiles=reflection-config.json --initialize-at-build-time= -H:InitialCollectionPolicy=com.oracle.svm.core.genscavenge.CollectionPolicy$BySpaceAndTime -H:+JNI -jar gos-arrow-0.0.1-runner.jar -H:FallbackThreshold=0 -H:+ReportExceptionStackTraces -J-Xmx7g -H:-AddAllCharsets -H:EnableURLProtocols=http --no-server -H:-UseServiceLoaderFeature -H:+StackTrace gos-arrow-0.0.1-runner
Error: Invalid Path entry gos-arrow-0.0.1-runner.jar
Caused by: java.nio.file.NoSuchFileException: /project/gos-arrow-0.0.1-runner.jar

I've checked gos-arrow-0.0.1-runner.jar is in the target directory.

Expected behavior
Should build the native image

Actual behavior
Fail

To Reproduce
Steps to reproduce the behavior:

  1. install minikube
  2. run:
$ eval $(minikube docker-env)  
  1. build a native image with :
$ mvn package -Pnative -Dquarkus.native.container-build=true

Environment (please complete the following information):

  • Quarkus version or git rev: 1.3.0.Alpha1
@ia3andy ia3andy added the kind/bug Something isn't working label Feb 12, 2020
@ia3andy ia3andy changed the title Building the native image with minikube docker Building a native image with minikube docker fails Feb 12, 2020
@ia3andy
Copy link
Contributor Author

ia3andy commented Feb 12, 2020

[ERROR] Failed to execute goal io.quarkus:quarkus-maven-plugin:1.3.0.Alpha1:native-image (default) on project gos-arrow: Failed to generate native image: io.quarkus.builder.BuildException: Build failure: Build failed due to errors
[ERROR]         [error]: Build step io.quarkus.deployment.pkg.steps.NativeImageBuildStep#build threw an exception: java.lang.RuntimeException: Failed to build native image
[ERROR]         at io.quarkus.deployment.pkg.steps.NativeImageBuildStep.build(NativeImageBuildStep.java:342)
[ERROR]         at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[ERROR]         at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
[ERROR]         at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
[ERROR]         at java.base/java.lang.reflect.Method.invoke(Method.java:566)
[ERROR]         at io.quarkus.deployment.ExtensionLoader$2.execute(ExtensionLoader.java:915)
[ERROR]         at io.quarkus.builder.BuildContext.run(BuildContext.java:279)
[ERROR]         at org.jboss.threads.ContextClassLoaderSavingRunnable.run(ContextClassLoaderSavingRunnable.java:35)
[ERROR]         at org.jboss.threads.EnhancedQueueExecutor.safeRun(EnhancedQueueExecutor.java:2027)
[ERROR]         at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.doRunTask(EnhancedQueueExecutor.java:1551)
[ERROR]         at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1442)
[ERROR]         at java.base/java.lang.Thread.run(Thread.java:834)
[ERROR]         at org.jboss.threads.JBossThread.run(JBossThread.java:479)
[ERROR] Caused by: java.lang.RuntimeException: Image generation failed. Exit code: 1
[ERROR]         at io.quarkus.deployment.pkg.steps.NativeImageBuildStep.build(NativeImageBuildStep.java:331)
[ERROR]         ... 12 more
[ERROR] -> [Help 1]

@banshay
Copy link

banshay commented Mar 2, 2020

For me, the same thing happens without minikube installed. Just setting up a project and running mvn package -Pnative -Dquarkus.native.container-build=true fails with the exception
Caused by: java.nio.file.NoSuchFileException: /project/PROJECT_NAME_VERSION.jar

@ia3andy
Copy link
Contributor Author

ia3andy commented Mar 2, 2020

@geoand any thoughts?

@geoand
Copy link
Contributor

geoand commented Mar 2, 2020

Building a native image with any docker daemon other than the localhost daemon will fail because the jar is built locally, not on whatever host the daemon is running

@ia3andy
Copy link
Contributor Author

ia3andy commented Mar 2, 2020

Ok then, should we close this as a "wont fix"? (or is this something we should cover)?

@geoand
Copy link
Contributor

geoand commented Mar 2, 2020

We should probably close since it's a duplicate of #1610

@ia3andy ia3andy closed this as completed Mar 2, 2020
@gsmet gsmet added the triage/duplicate This issue or pull request already exists label Mar 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Something isn't working triage/duplicate This issue or pull request already exists
Projects
None yet
Development

No branches or pull requests

4 participants