Open iocanel opened 2 years ago
- Why do you think that we have an issue with this builder as the error is reported by the Java Buildpack client and not during the image build ?
The client is processing the metadata that are obtained from the builder image
and fails. It works fine with the quarkus builder image and the default builder image, too.
- Why do we have to use jbang ? What is the added value of using jbang ? @iocanel
We don't have to. It's just the easier way possible to use the java client without setting up a project.
To expand a bit here.. builder images should have a label 'io.buildpacks.builder.metadata' which is looked for by the platform, because it contains json that defines (amongst other things) the runImage that should be used when building apps with the builder image.
From the stack trace, it would appear that the label is absent, or is being given back to the buildpack client code as null.
What does docker inspect
(or pack inspect
) show for the builder image ?
fails
Is there a way to get a more verbose response ? @BarDweller
fails
Is there a way to get a more verbose response ? @BarDweller
Yes, we can probably update the client to have a more graceful error in this situation. It's unexpected though.. I guess you'd see it if you used a non-builder image by mistake. Could add some basic checks to see if the image has the required metadata and exit appropriately. That won't fix this image tho, it'll just make it less stack-tracey ;)
That won't fix this image tho, it'll just make it less stack-tracey ;)
So 2 actions are needed; 1) add the missing label top of this builder image and 2) Make the java buildpack client a bit more verbose
. Can you work on that (create issues, ...) ? @BarDweller
I'm having a quick peek first to try to confirm where that property is referenced in the specs. It's nearly a year since I wrote the java buildpack client, the specs have moved on a few revisions since... makes sense to go back and ensure the label is valid (and if not, what it should be doing instead)
Aha.. so .. a bit more digging, @iocanel the problem is you're trying to use a stack as a builder.
.withBuildImage("redhat/buildpacks-stack-snowdrop-build:jvm")
should be
.withBuildImage("redhat/buildpacks-builder-maven-jvm:latest")
That's why the image you've selected is missing the metadata label, and fails =)
That won't fix this image tho, it'll just make it less stack-tracey ;)
So 2 actions are needed; 1) add the missing label top of this builder image and 2) Make the java buildpack client a bit more
verbose
. Can you work on that (create issues, ...) ? @BarDweller
1) not required, builder image already has correct labels, initial reported bug is using incorrect image. 2) https://github.com/snowdrop/java-buildpack-client/issues/27
I tried using the buildpacks against a spring and quarkus sample app. In both cases I got this error on examples that we working fine with other builder images.
Steps to reproduce (requires jbang)
Clone the project:
Edit
pack.java
and add the following line to the builder:Invoke the build: