jib: Can't use Jib with Quarkus

I tried to use Jib Maven with Quarkus and it turned out not working at all.

Basically, Jib can’t find the Main class and can’t copy the dependency libs because all of them are provided scope.

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Reactions: 8
  • Comments: 29 (12 by maintainers)

Most upvoted comments

@gunnarmorling @geoand @maxandersen @cmoulliard @OneCricketeer @sureshg @dgageot @saturnism @daggerok @sirAlexander @ScheerMT @dennisjagut @Tanmayshetty @krishnaarava @Tombar @jycr @DaHoC @yazidaqel @sdavids @xmlking @jabrena @mehmandarov @YacheLee

Although Quarkus added native Jib image building on their side a while ago, we still wanted to allow Jib build plugin users to containerize Quarkus apps. However, as mentioned above, we thought adding specialized code for every app framework and non-conventional feature requests into Jib plugins is not sustainable or maintainable in the long run. For this reason, we implemented the Jib extension framework which gives the user the power to tweak and extend Jib plugin workings.

With the new extension framework, now we enabled Quarkus support in Jib plugins through the release of Jib Quarkus Extensions (Maven / Gradle). Currently, the extensions only work for the default packaging mode (e.g., no support for uber-jar package type), but we should be able to add more support in the extensions in the future. Another point of supporting Quarkus through an extension is to attract more contributions from interested parties and the community, so we are more than welcome to have your contributions.

Would be good to be able to also build the docker images for the native-image part of quarkus. I know this is maybe not in the scope of Jib (java application only), but I think this could be good!

@davinkevin ultimately, our Jib Quarkus Extensions can be expanded to cover the native-image package type. Related, we will soon write another Jib extension to support a general native GraalVM (i.e., non-Quarkus) containerization.

Closing the issue.

Or better yet, quarkus could use Jib-Core internally to package their container image!

Support for Quarkus has been added on the Quarkus side. See https://quarkus.io/guides/container-image#jib

If it’s of interest, I’ve pushed a minimal example of what I currently have to a repo here. I think the dependency issue outlined before is a problem, though.

@cmoulliard initially we had considered adding special support for Quarkus inside Jib, which might have been not so difficult to add in a short time frame. However, as we explored other closely related issues as well as other various issues, we’ve conceived something very general at a grand scale that can cover a wide spectrum of use cases including Quarkus. This new idea requires a lot of rearchitecturing of Jib codebase, so unfortunately this will take quite some time to be materialized.

@geoand thanks for explaining and confirming. This helps a lot. If you need any help in the meantime, let us know.

Can you rename my-app-1.0.0-SNAPSHOT-runner.jar to my-app-1.0.0-SNAPSHOT.jar and run Jib (don’t do mvn clean) to see if it works?

Yes, that works!

then we might need to ensure the quarkus goal is executed before jib tries to access the artifact.

I don’t think the runner JAR is actually set as the artifact, as mvn package jib:dockerBuild fails (which does run the Quarkus Maven plug-in before Jib). I reckon that the plug-in just creates the runner JAR “out of bands”.