snowdrop-zen / quarkus

Quarkus: Supersonic Subatomic Java.
https://quarkus.io
Apache License 2.0
1 stars 0 forks source link

NativeImageBuildStep fails if 'docker' is not installed #148

Closed snowdrop-bot closed 4 years ago

snowdrop-bot commented 4 years ago

Describe the bug On a Fedora 32 fresh installation where 'docker' command is not installed because 'podman' is only available to run containers, I found the following exception when compiled a simple HelloWorld project:

`$ mvn clean package -Pnative -Dquarkus.native.container-build=true [INFO] Scanning for projects... [INFO] [INFO] ---------------------< org.acme:code-with-quarkus >--------------------- [INFO] Building code-with-quarkus 1.0.0-SNAPSHOT [INFO] --------------------------------[ jar ]---------------------------------

[INFO] [INFO] --- quarkus-maven-plugin:1.6.1.Final:build (default) @ code-with-quarkus --- [INFO] [org.jboss.threads] JBoss Threads version 3.1.1.Final [INFO] [io.quarkus.deployment.pkg.steps.JarResultBuildStep] Building native image source jar: /home/rmarting/Workspaces/ws-crs/quarkus-sample/target/code-with-quarkus-1.0.0-SNAPSHOT-native-image-source-jar/code-with-quarkus-1.0.0-SNAPSHOT-runner.jar [INFO] [io.quarkus.deployment.pkg.steps.NativeImageBuildStep] Building native image from /home/rmarting/Workspaces/ws-crs/quarkus-sample/target/code-with-quarkus-1.0.0-SNAPSHOT-native-image-source-jar/code-with-quarkus-1.0.0-SNAPSHOT-runner.jar [INFO] [io.quarkus.deployment.pkg.steps.NativeImageBuildStep] Checking image status quay.io/quarkus/ubi-quarkus-native-image:20.1.0-java11 [INFO] ------------------------------------------------------------------------ [INFO] BUILD FAILURE [INFO] ------------------------------------------------------------------------ [INFO] Total time: 8.124 s [INFO] Finished at: 2020-07-27T12:57:40+02:00 [INFO] ------------------------------------------------------------------------ [ERROR] Failed to execute goal io.quarkus:quarkus-maven-plugin:1.6.1.Final:build (default) on project code-with-quarkus: Failed to build quarkus application: 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 pull builder image quay.io/quarkus/ubi-quarkus-native-image:20.1.0-java11 [ERROR] at io.quarkus.deployment.pkg.steps.NativeImageBuildStep.build(NativeImageBuildStep.java:134) [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:932) [ERROR] at io.quarkus.builder.BuildContext.run(BuildContext.java:277) [ERROR] at org.jboss.threads.ContextClassLoaderSavingRunnable.run(ContextClassLoaderSavingRunnable.java:35) [ERROR] at org.jboss.threads.EnhancedQueueExecutor.safeRun(EnhancedQueueExecutor.java:2046) [ERROR] at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.doRunTask(EnhancedQueueExecutor.java:1578) [ERROR] at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1452) [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.io.IOException: Cannot run program "docker": error=2, No such file or directory [ERROR] at java.base/java.lang.ProcessBuilder.start(ProcessBuilder.java:1128) [ERROR] at java.base/java.lang.ProcessBuilder.start(ProcessBuilder.java:1071) [ERROR] at io.quarkus.deployment.util.ProcessUtil.launchProcess(ProcessUtil.java:37) [ERROR] at io.quarkus.deployment.pkg.steps.NativeImageBuildStep.build(NativeImageBuildStep.java:131) [ERROR] ... 12 more [ERROR] Caused by: java.io.IOException: error=2, No such file or directory [ERROR] at java.base/java.lang.ProcessImpl.forkAndExec(Native Method) [ERROR] at java.base/java.lang.ProcessImpl.(ProcessImpl.java:340) [ERROR] at java.base/java.lang.ProcessImpl.start(ProcessImpl.java:271) [ERROR] at java.base/java.lang.ProcessBuilder.start(ProcessBuilder.java:1107) [ERROR] ... 15 more [ERROR] -> [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/MojoExecutionException `

I made an alias between docker and podman as:

alias docker=podman

However with the same failure.

Expected behavior (Describe the expected behavior clearly and concisely.)

Actual behavior (Describe the actual behavior clearly and concisely.)

To Reproduce Steps to reproduce the behavior:

  1. Create a simple helloworld sample
  2. 'docker' cli not installed
  3. Build project as: mvn clean package -Pnative -Dquarkus.native.container-build=true

Environment :


https://github.com/quarkusio/quarkus/issues/10984


$upstream:10984$