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

Quarkus 3 quarkus.package.type=native-sources require docker/podman or native-image #33161

Closed
mbecca opened this issue May 5, 2023 · 2 comments · Fixed by #33368
Closed

Quarkus 3 quarkus.package.type=native-sources require docker/podman or native-image #33161

mbecca opened this issue May 5, 2023 · 2 comments · Fixed by #33368
Assignees
Labels
env/podman kind/bug Something isn't working
Milestone

Comments

@mbecca
Copy link

mbecca commented May 5, 2023

Describe the bug

Starting from version 3 of Quarkus, the behavior of the command './gradlew build '-Dquarkus.package.type=native-sources'' changed, as it now requires either Docker/Podman or native-image installed on the host. Up until version 2.16.0.Final, it did not require Docker or native-image to be installed.

Expected behavior

It is expected not to require Docker/Podman or native-image, just as it worked in version 2.16.

Actual behavior

 ./gradlew build -Dquarkus.package.type=native-sources                                                       ─╯

> Configure project :
WARNING: The task 'testCodeCoverageReport' of type 'JacocoReport' does not follow the naming convention "jacoco(TestTask)Report", where "TestTask" is the capitalized name of the test task covered by the report. We improvise by using 'jacocoLogCoverage13' as a fallback task name.
WARNING: The task 'integrationTestsCodeCoverageReport' of type 'JacocoReport' does not follow the naming convention "jacoco(TestTask)Report", where "TestTask" is the capitalized name of the test task covered by the report. We improvise by using 'jacocoLogCoverage14' as a fallback task name.
Cannot find the `native-image` in the GRAALVM_HOME, JAVA_HOME and System PATH. Install it using `gu install native-image` Attempting to fall back to container build.

> Task :quarkusBuild FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':quarkusBuild'.
> There was a failure while executing work items
   > A failure occurred while executing io.quarkus.gradle.tasks.worker.BuildWorker
      > io.quarkus.builder.BuildException: Build failure: Build failed due to errors
                [error]: Build step io.quarkus.deployment.pkg.steps.NativeImageBuildStep#resolveNativeImageBuildRunner threw an exception: java.lang.IllegalStateException: No container runtime was found. Make sure you have either Docker or Podman installed in your environment.
                at io.quarkus.runtime.util.ContainerRuntimeUtil.detectContainerRuntime(ContainerRuntimeUtil.java:99)
                at io.quarkus.runtime.util.ContainerRuntimeUtil.detectContainerRuntime(ContainerRuntimeUtil.java:41)
                at java.base/java.util.Optional.orElseGet(Optional.java:364)
                at io.quarkus.deployment.pkg.steps.NativeImageBuildContainerRunner.<init>(NativeImageBuildContainerRunner.java:31)
                at io.quarkus.deployment.pkg.steps.NativeImageBuildLocalContainerRunner.<init>(NativeImageBuildLocalContainerRunner.java:21)
                at io.quarkus.deployment.pkg.steps.NativeImageBuildStep.resolveNativeImageBuildRunner(NativeImageBuildStep.java:332)
                at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
                at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
                at java.base/java.lang.reflect.Method.invoke(Method.java:568)
                at io.quarkus.deployment.ExtensionLoader$3.execute(ExtensionLoader.java:909)
                at io.quarkus.builder.BuildContext.run(BuildContext.java:282)
                at org.jboss.threads.ContextHandler$1.runWith(ContextHandler.java:18)
                at org.jboss.threads.EnhancedQueueExecutor$Task.run(EnhancedQueueExecutor.java:2513)
                at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1538)
                at java.base/java.lang.Thread.run(Thread.java:833)
                at org.jboss.threads.JBossThread.run(JBossThread.java:501)

How to Reproduce?

No response

Output of uname -a or ver

No response

Output of java -version

17

GraalVM version (if different from Java)

No response

Quarkus version or git rev

3.0.2

Build tool (ie. output of mvnw --version or gradlew --version)

gardlew 8

Additional information

No response

@mbecca mbecca added the kind/bug Something isn't working label May 5, 2023
@geoand
Copy link
Contributor

geoand commented May 7, 2023

cc @Karm @zakkak

@tux-o-matic
Copy link

+1
The recommended way to do native build in CI with Tekton is to split package with the -Dquarkus.package.type=native-sources parameter and then follow up with another Task that has the native-image compiler.
Quarkus 3.0 seems to have broken that.

@zakkak zakkak self-assigned this May 11, 2023
zakkak added a commit to zakkak/quarkus that referenced this issue May 15, 2023
zakkak added a commit to zakkak/quarkus that referenced this issue May 15, 2023
@quarkus-bot quarkus-bot bot added this to the 3.2 - main milestone May 17, 2023
@gsmet gsmet modified the milestones: 3.2 - main, 3.1.0.Final May 23, 2023
gsmet pushed a commit to gsmet/quarkus that referenced this issue May 23, 2023
@gsmet gsmet modified the milestones: 3.1.0.Final, 3.0.4.Final May 23, 2023
gsmet pushed a commit to gsmet/quarkus that referenced this issue May 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
env/podman kind/bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants