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

Run ./gradlew quarkusBuild failed when setting 'quarkus.docker.dockerfile-jvm-path' in multi module of gradle project #14312

Closed
River-java opened this issue Jan 15, 2021 · 4 comments · Fixed by #14324
Labels
area/gradle Gradle kind/bug Something isn't working
Milestone

Comments

@River-java
Copy link

River-java commented Jan 15, 2021

Describe the bug
(Describe the problem clearly and concisely.)
Run quarkusBuild would be failed when specifying the docker file path to the sub-module.

Expected behavior
The application project and image would build successfully.

Actual behavior

Execution failed for task ':application:quarkusBuild'.
> io.quarkus.builder.BuildException: Build failure: Build failed due to errors
        [error]: Build step io.quarkus.container.image.docker.deployment.DockerProcessor#dockerBuildFromJar threw an exception: java.lang.IllegalArgumentException: Specified Dockerfile path /Users/bob/work/personal projects/quakusio/my-artifactId/application/src/main/docker/Dockerfile.local does not exist
        at io.quarkus.container.image.docker.deployment.DockerProcessor$ProvidedDockerfile.get(DockerProcessor.java:342)
        at io.quarkus.container.image.docker.deployment.DockerProcessor.getDockerfilePaths(DockerProcessor.java:227)
        at io.quarkus.container.image.docker.deployment.DockerProcessor.createContainerImage(DockerProcessor.java:134)
        at io.quarkus.container.image.docker.deployment.DockerProcessor.dockerBuildFromJar(DockerProcessor.java:86)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.base/java.lang.reflect.Method.invoke(Method.java:566)
        at io.quarkus.deployment.ExtensionLoader$2.execute(ExtensionLoader.java:932)
        at io.quarkus.builder.BuildContext.run(BuildContext.java:277)
        at org.jboss.threads.ContextClassLoaderSavingRunnable.run(ContextClassLoaderSavingRunnable.java:35)
        at org.jboss.threads.EnhancedQueueExecutor.safeRun(EnhancedQueueExecutor.java:2046)
        at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.doRunTask(EnhancedQueueExecutor.java:1578)
        at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1452)
        at java.base/java.lang.Thread.run(Thread.java:834)
        at org.jboss.threads.JBossThread.run(JBossThread.java:479)

But the docker file does exist in the specified path. I tried to update the path to
quarkus.docker.dockerfile-jvm-path=application/src/main/docker/Dockerfile.local
still get error:

Execution failed for task ':application:quarkusBuild'.
> io.quarkus.builder.BuildException: Build failure: Build failed due to errors
        [error]: Build step io.quarkus.container.image.docker.deployment.DockerProcessor#dockerBuildFromJar threw an exception: java.lang.RuntimeException: Execution of 'docker build -f /Users/bob/work/personal projects/quakusio/my-artifactId/application/application/src/main/docker/Dockerfile.local -t bob/application:unspecified /Users/bob/work/personal projects/quakusio/my-artifactId/application' failed. See docker output for more details
        at io.quarkus.container.image.docker.deployment.DockerProcessor.dockerException(DockerProcessor.java:184)
        at io.quarkus.container.image.docker.deployment.DockerProcessor.createContainerImage(DockerProcessor.java:130)
        at io.quarkus.container.image.docker.deployment.DockerProcessor.dockerBuildFromJar(DockerProcessor.java:79)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.base/java.lang.reflect.Method.invoke(Method.java:566)

Because the path /application is duplicated.
docker build -f /Users/bob/work/personal projects/quakusio/my-artifactId/application/application/src/main/docker/Dockerfile.local -t bob/application:unspecified /Users/bob/work/personal projects/quakusio/my-artifactId/application

To Reproduce
Steps to reproduce the behavior:

  1. add quarkus-container-image-docker dependency.
  2. add config to the application.properties
   quarkus.container-image.build=true
   quarkus.docker.dockerfile-jvm-path=src/main/docker/Dockerfile.local
  1. Execute
    ./gradlew application:quarkusBuild

Configuration

# Add your application.properties here, if applicable.

Screenshots
image

The screenshot is the multi-module gradle project structure

Environment (please complete the following information):
Quarkus version: 1.5.2.Final
JDK version: 11.0.9

@River-java River-java added the kind/bug Something isn't working label Jan 15, 2021
@ghost ghost added the area/gradle Gradle label Jan 15, 2021
@ghost
Copy link

ghost commented Jan 15, 2021

/cc @glefloch, @quarkusio/devtools

@geoand
Copy link
Contributor

geoand commented Jan 15, 2021

@River-java do you have perhaps have a reproducer project to share?

Furthermore, can you try with more recent versions of Quarkus? 1.5.2 is quite old :)

@glefloch
Copy link
Member

glefloch commented Jan 15, 2021

I just reproduced the error with the latest master branch. I'm having a look at the error.

@River-java
Copy link
Author

@glefloch @geoand Thank you.

@gsmet gsmet modified the milestones: 1.12 - master, 1.11.1.Final Jan 18, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/gradle Gradle kind/bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants