Skip to content

Switch to ubuntu-resolute-builder as the default builder - #51249

Open
anthonydahanne wants to merge 2 commits into
spring-projects:mainfrom
anthonydahanne:update-buildpack-builder
Open

anthonydahanne wants to merge 2 commits into
spring-projects:mainfrom
anthonydahanne:update-buildpack-builder

Conversation

@anthonydahanne

Copy link
Copy Markdown
Contributor
  • replacing Noble
  • not addressing the spring-boot-cnb-test-builder still based on Noble yet; it could wait for this PR to be merged first.

Hello Spring friends 👋

This is a candidate PR to upgrade Spring Boot to using the latest Ubuntu LTS: Resolute.

I think it's in a good shape, and would represent progress to Spring users.

Now, I understand you probably don't want to change the builder during a random patch release; so I suggest we let this PR open, and you target it to the proper versions, and on my side I'll keep it up to date against main

Also, if you're open to contributions for upgrading spring-io/spring-boot-cnb-test-builder to Resolute too, I'd be happy to, just tell me and I PR that.

Happy reviewing 📖 ☕ !

@anthonydahanne
anthonydahanne force-pushed the update-buildpack-builder branch from f812f8d to f32c716 Compare August 3, 2026 22:20
@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Aug 3, 2026
@anthonydahanne
anthonydahanne force-pushed the update-buildpack-builder branch 3 times, most recently from 22f22d9 to 95f9f67 Compare August 4, 2026 13:38
@ThomasVitale

Copy link
Copy Markdown

This is great! Does it also solve #51166?

@anthonydahanne

Copy link
Copy Markdown
Contributor Author

This is great! Does it also solve #51166?

ah! I just looked at it, and yes, I guess setting the run-image by default is what's missing now.

So yes, this PR should solve that issue too

@philwebb philwebb changed the title chore: Switch to ubuntu-resolute-builder as the default builder Switch to ubuntu-resolute-builder as the default builder Aug 9, 2026
@mhalbritter mhalbritter self-assigned this Aug 12, 2026
@mhalbritter

mhalbritter commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

Hello @anthonydahanne,

thanks for the PR! Just for my understanding: builder-noble-java-tiny was a builder which run image had no shell. This PR switches to ubuntu-resolute-builder, whose default run image is includes a shell. Is that what Paketo recommends? Using the full image by default, and only opting into the tiny image on demand?

@mhalbritter mhalbritter added type: enhancement A general enhancement status: waiting-for-feedback We need additional information before we can continue and removed status: waiting-for-triage An issue we've not yet triaged labels Aug 12, 2026
@mhalbritter mhalbritter added this to the 4.2.x milestone Aug 12, 2026
@anthonydahanne
anthonydahanne force-pushed the update-buildpack-builder branch from 4c78468 to 4b7bbf3 Compare September 10, 2026 04:18
@anthonydahanne

anthonydahanne commented Sep 10, 2026

Copy link
Copy Markdown
Contributor Author

Hello @mhalbritter , sorry for late answer, working on my github filters 🫠 ...

So,

builder-noble-java-tiny was a builder which run image had no shell.

yes

This PR switches to ubuntu-resolute-builder

yes

whose default run image is includes a shell.

yes

Is that what Paketo recommends? Using the full image by default, and only opting into the tiny image on demand?

Yeah, what changed really is that we have less builders than before, and rely more on runImage - we updated samples that way too

WRT tiny and native, I just added a new commit, so that -Pnative and equivalent do use tiny automatically.

How it works:

  • In BuildRequest, when BP_NATIVE_IMAGE=true and the default builder is used (and no run image is set explicitly), the run image defaults to paketobuildpacks/ubuntu-resolute-run-tiny.
  • Both -Pnative flows now set that env at the same spot where they already mark the build native: Gradle in NativeImagePluginAction, Maven in spring-boot-starter-parent's native profile. So mvn -Pnative spring-boot:build-image and gradle bootBuildImage with the Native Build Tools plugin both pick the tiny run image on their own.
  • A user can still override it, e.g. to keep the full run image:
<configuration>
   <image>
     <runImage>paketobuildpacks/ubuntu-resolute-run</runImage>
   </image>
 </configuration>

It also relies on your recent change that turned the stack-id mismatch into a warning rather than an error : ubuntu-resolute-run-tiny carries io.buildpacks.stacks.resolute.tiny while the builder is io.buildpacks.stacks.resolute, so the build now logs a warning and proceeds. Happy to suppress that specific warning for the resolute/tiny pairing if you'd prefer a clean log on the default native path.

This should also close #51166.

@anthonydahanne
anthonydahanne force-pushed the update-buildpack-builder branch from 4b7bbf3 to bb3695d Compare September 10, 2026 04:31
…lder

* replacing Noble
* not addressing the spring-boot-cnb-test-builder still based on Noble yet; it could wait for this PR to be merged first.

Signed-off-by: Anthony Dahanne <anthony.dahanne@gmail.com>
…lder

* Add support for native image builds with Buildpacks
* Introduced compatibility checks for Stack IDs.
* Configured default tiny run image for native builds (`BP_NATIVE_IMAGE=true`).
* Enabled Gradle and Maven plugins to set `BP_NATIVE_IMAGE` environment variable during build image tasks.

Signed-off-by: Anthony Dahanne <anthony.dahanne@gmail.com>
@anthonydahanne
anthonydahanne force-pushed the update-buildpack-builder branch from bb3695d to 8cfd036 Compare September 10, 2026 04:33
@spring-projects-issues spring-projects-issues added status: feedback-provided Feedback has been provided and removed status: waiting-for-feedback We need additional information before we can continue labels Sep 10, 2026
@mhalbritter

mhalbritter commented Sep 17, 2026

Copy link
Copy Markdown
Contributor

I'm thinking about to switch the run image unconditionally to the shell-less variant (as we have now), and if users want to have a shell, they can opt in by changing the run image. This would preserve the same behavior as we have today, and we could drop the changes for the native image case.

Only downside is that we get a warning every build about non-matching stack ids (the same warning pack gives):

Ours:

Warning: Run image stack 'io.buildpacks.stacks.resolute.tiny' does not match builder stack 'io.buildpacks.stacks.resolute'. Stack IDs are deprecated, but the images may not be compatible.

pack's:

Warning: deprecated usage of stack.

The fix for the warning, if we want to diverge from pack behavior: #51166 asked for it (long term solution): skip it when io.buildpacks.base.distro.name / .version or io.buildpacks.stack.distro.name / .version match on both images, drop stack comparison.

Let me talk to the team about that.

@mhalbritter mhalbritter added the for: team-meeting An issue we'd like to discuss as a team to make progress label Sep 17, 2026
@wilkinsona

wilkinsona commented Sep 17, 2026

Copy link
Copy Markdown
Member

I consider our alignment with pack to be a bit higher level than how or if we warn about something. Relaxing the constraint so that we didn't fail achieved that. We should now feel free to refine things from there. As long as we don't start failing again, we'll still be aligned at the level that we need to be.

Having thought about this some more, I don't think the current warnings (either ours or pack's) are particularly helpful as there are situations where the user can't really do anything to fix it. I think it makes sense to change things so that this fairly common scenario is warning free.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

for: team-meeting An issue we'd like to discuss as a team to make progress status: feedback-provided Feedback has been provided type: enhancement A general enhancement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants