Skip to content

Commit 0885e33

Browse files
chore: Switch to ubuntu-resolute-builder as the default Buildpacks builder
* 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>
1 parent 6dabe4a commit 0885e33

10 files changed

Lines changed: 24 additions & 16 deletions

File tree

build-plugin/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/pages/packaging-oci-image.adoc

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -131,12 +131,12 @@ The following table summarizes the available properties and their default values
131131
| `builder`
132132
| `--builder`
133133
| Name of the builder image to use.
134-
| `paketobuildpacks/builder-noble-java-tiny:latest`
134+
| `paketobuildpacks/ubuntu-resolute-builder:latest`
135135

136136
| `trustBuilder`
137137
| `--trustBuilder`
138138
| Whether to treat the builder as {url-buildpacks-docs}/for-platform-operators/how-to/integrate-ci/pack/concepts/trusted_builders/#what-is-a-trusted-builder[trusted].
139-
| `true` if the builder is one of `paketobuildpacks/builder-noble-java-tiny`, `paketobuildpacks/builder-jammy-java-tiny`, `paketobuildpacks/builder-jammy-tiny`, `paketobuildpacks/builder-jammy-base`, `paketobuildpacks/builder-jammy-full`, `paketobuildpacks/builder-jammy-buildpackless-tiny`, `paketobuildpacks/builder-jammy-buildpackless-base`, `paketobuildpacks/builder-jammy-buildpackless-full`, `gcr.io/buildpacks/builder`, `heroku/builder`; `false` otherwise.
139+
| `true` if the builder is one of `paketobuildpacks/ubuntu-resolute-builder`, `paketobuildpacks/ubuntu-resolute-builder-buildpackless`, `paketobuildpacks/builder-noble-java-tiny`, `paketobuildpacks/builder-jammy-java-tiny`, `paketobuildpacks/builder-jammy-tiny`, `paketobuildpacks/builder-jammy-base`, `paketobuildpacks/builder-jammy-full`, `paketobuildpacks/builder-jammy-buildpackless-tiny`, `paketobuildpacks/builder-jammy-buildpackless-base`, `paketobuildpacks/builder-jammy-buildpackless-full`, `gcr.io/buildpacks/builder`, `heroku/builder`; `false` otherwise.
140140

141141
| `imagePlatform`
142142
| `--imagePlatform`
@@ -263,8 +263,8 @@ NOTE: The plugin detects the target Java compatibility of the project using the
263263
When using the default Paketo builder and buildpacks, the plugin instructs the buildpacks to install the same Java version.
264264
You can override this behavior as shown in the xref:packaging-oci-image.adoc#build-image.examples.builder-configuration[builder configuration] examples.
265265

266-
NOTE: The default builder `paketobuildpacks/builder-noble-java-tiny:latest` contains a reduced set of system libraries and does not include a shell.
267-
Applications that require a shell to run a start script, as might be the case when the {url-gradle-docs-application-plugin}[`application` plugin] has been applied to generate a distribution zip archive, or that depend upon a system library that is not present, should override the `runImage` configuration to use one that includes a shell and a broader set of system libraries, such as `paketobuildpacks/ubuntu-noble-run:latest`.
266+
NOTE: The default builder `paketobuildpacks/ubuntu-resolute-builder:latest` uses the `paketobuildpacks/ubuntu-resolute-run:latest` run image, which includes a shell and a broad set of system libraries.
267+
Applications that want a reduced footprint and attack surface, as is typically the case for native images, should override the `runImage` configuration to use one that does not include a shell, such as `paketobuildpacks/ubuntu-resolute-run-tiny:latest`.
268268

269269

270270

build-plugin/spring-boot-gradle-plugin/src/test/java/org/springframework/boot/gradle/tasks/bundling/BootBuildImageTests.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ void whenUsingDefaultConfigurationThenRequestHasPublishDisabled() {
194194
@Test
195195
void whenNoBuilderIsConfiguredThenRequestHasDefaultBuilder() {
196196
BuildRequest request = this.buildImage.createRequest();
197-
assertThat(request.getBuilder().getName()).isEqualTo("paketobuildpacks/builder-noble-java-tiny");
197+
assertThat(request.getBuilder().getName()).isEqualTo("paketobuildpacks/ubuntu-resolute-builder");
198198
assertThat(request.isTrustBuilder()).isTrue();
199199
}
200200

build-plugin/spring-boot-maven-plugin/src/docs/antora/modules/maven-plugin/examples/aot-native-profile-buildpacks/pom.xml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,11 @@
1212
<plugin>
1313
<groupId>org.springframework.boot</groupId>
1414
<artifactId>spring-boot-maven-plugin</artifactId>
15+
<configuration>
16+
<image>
17+
<runImage>paketobuildpacks/ubuntu-resolute-run-tiny</runImage>
18+
</image>
19+
</configuration>
1520
<executions>
1621
<execution>
1722
<id>build-image</id>

build-plugin/spring-boot-maven-plugin/src/docs/antora/modules/maven-plugin/pages/build-image.adoc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -149,12 +149,12 @@ The following table summarizes the available parameters and their default values
149149
| `builder` +
150150
(`spring-boot.build-image.builder`)
151151
| Name of the builder image to use.
152-
| `paketobuildpacks/builder-noble-java-tiny:latest`
152+
| `paketobuildpacks/ubuntu-resolute-builder:latest`
153153

154154
| `trustBuilder` +
155155
(`spring-boot.build-image.trustBuilder`)
156156
| Whether to treat the builder as {url-buildpacks-docs}/for-platform-operators/how-to/integrate-ci/pack/concepts/trusted_builders/#what-is-a-trusted-builder[trusted].
157-
| `true` if the builder is one of `paketobuildpacks/builder-noble-java-tiny`, `paketobuildpacks/builder-jammy-java-tiny`, `paketobuildpacks/builder-jammy-tiny`, `paketobuildpacks/builder-jammy-base`, `paketobuildpacks/builder-jammy-full`, `paketobuildpacks/builder-jammy-buildpackless-tiny`, `paketobuildpacks/builder-jammy-buildpackless-base`, `paketobuildpacks/builder-jammy-buildpackless-full`, `gcr.io/buildpacks/builder`, `heroku/builder`; `false` otherwise.
157+
| `true` if the builder is one of `paketobuildpacks/ubuntu-resolute-builder`, `paketobuildpacks/ubuntu-resolute-builder-buildpackless`, `paketobuildpacks/builder-noble-java-tiny`, `paketobuildpacks/builder-jammy-java-tiny`, `paketobuildpacks/builder-jammy-tiny`, `paketobuildpacks/builder-jammy-base`, `paketobuildpacks/builder-jammy-full`, `paketobuildpacks/builder-jammy-buildpackless-tiny`, `paketobuildpacks/builder-jammy-buildpackless-base`, `paketobuildpacks/builder-jammy-buildpackless-full`, `gcr.io/buildpacks/builder`, `heroku/builder`; `false` otherwise.
158158

159159
| `imagePlatform` +
160160
(`spring-boot.build-image.imagePlatform`)

build-plugin/spring-boot-maven-plugin/src/test/java/org/springframework/boot/maven/ImageTests.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ void getBuildRequestWhenNameIsSetUsesName() {
7373
void getBuildRequestWhenNoCustomizationsUsesDefaults() {
7474
BuildRequest request = new Image().getBuildRequest(createArtifact(), mockApplicationContent());
7575
assertThat(request.getName()).hasToString("docker.io/library/my-app:0.0.1-SNAPSHOT");
76-
assertThat(request.getBuilder().toString()).contains("paketobuildpacks/builder-noble-java-tiny");
76+
assertThat(request.getBuilder().toString()).contains("paketobuildpacks/ubuntu-resolute-builder");
7777
assertThat(request.isTrustBuilder()).isTrue();
7878
assertThat(request.getRunImage()).isNull();
7979
assertThat(request.getEnv()).isEmpty();
@@ -111,7 +111,7 @@ void getBuildRequestWhenHasDefaultBuilderAndTrustBuilderUsesTrustBuilder() {
111111
Image image = new Image();
112112
image.trustBuilder = false;
113113
BuildRequest request = image.getBuildRequest(createArtifact(), mockApplicationContent());
114-
assertThat(request.getBuilder().toString()).contains("paketobuildpacks/builder-noble-java-tiny");
114+
assertThat(request.getBuilder().toString()).contains("paketobuildpacks/ubuntu-resolute-builder");
115115
assertThat(request.isTrustBuilder()).isFalse();
116116
}
117117

buildpack/spring-boot-buildpack-platform/src/main/java/org/springframework/boot/buildpack/platform/build/BuildRequest.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,11 +48,13 @@
4848
*/
4949
public class BuildRequest {
5050

51-
static final String DEFAULT_BUILDER_IMAGE_NAME = "paketobuildpacks/builder-noble-java-tiny";
51+
static final String DEFAULT_BUILDER_IMAGE_NAME = "paketobuildpacks/ubuntu-resolute-builder";
5252

5353
static final String DEFAULT_BUILDER_IMAGE_REF = DEFAULT_BUILDER_IMAGE_NAME + ":latest";
5454

5555
static final List<ImageReference> KNOWN_TRUSTED_BUILDERS = List.of(
56+
ImageReference.of("paketobuildpacks/ubuntu-resolute-builder"),
57+
ImageReference.of("paketobuildpacks/ubuntu-resolute-builder-buildpackless"),
5658
ImageReference.of("paketobuildpacks/builder-noble-java-tiny"),
5759
ImageReference.of("paketobuildpacks/builder-jammy-java-tiny"),
5860
ImageReference.of("paketobuildpacks/builder-jammy-tiny"),

documentation/spring-boot-docs/src/docs/antora/modules/how-to/pages/native-image/developing-your-first-application.adoc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,9 @@ This means you can just type a single command and quickly get a sensible image i
3333
The resulting image doesn't contain a JVM, instead the native image is compiled statically.
3434
This leads to smaller images.
3535

36-
NOTE: The CNB builder used for the images is `paketobuildpacks/builder-noble-java-tiny:latest`.
37-
It has a small footprint and reduced attack surface. It does not include a shell and contains a reduced set of system libraries.
38-
If you need more tools in the resulting image, you can use `paketobuildpacks/ubuntu-noble-run:latest` as the *run* image.
36+
NOTE: The CNB builder used for the images is `paketobuildpacks/ubuntu-resolute-builder:latest`.
37+
For native images, configure the `runImage` to use `paketobuildpacks/ubuntu-resolute-run-tiny:latest`, which has a small footprint and reduced attack surface: it does not include a shell and contains a reduced set of system libraries.
38+
If you need more tools in the resulting image, you can use the default `paketobuildpacks/ubuntu-resolute-run:latest` as the *run* image.
3939

4040
NOTE: You have to build your application with at least JDK 25, because Buildpacks use the same GraalVM native-image version as the Java version used for compilation.
4141

documentation/spring-boot-docs/src/docs/antora/modules/reference/pages/packaging/native-image/advanced-topics.adoc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,8 @@ Assuming an AOT processed Spring Boot executable jar built as `myproject-0.0.1-S
6767

6868
[source,shell]
6969
----
70-
$ pack build --builder paketobuildpacks/builder-noble-java-tiny \
70+
$ pack build --builder paketobuildpacks/ubuntu-resolute-builder \
71+
--run-image paketobuildpacks/ubuntu-resolute-run-tiny \
7172
--path target/myproject-0.0.1-SNAPSHOT.jar \
7273
--env 'BP_NATIVE_IMAGE=true' \
7374
my-application:0.0.1-SNAPSHOT

system-test/spring-boot-image-system-tests/src/systemTest/resources/org/springframework/boot/image/paketo/PaketoBuilderTests-plainDistZipJarApp.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,6 @@ application {
5555

5656
bootBuildImage {
5757
archiveFile = distZip.archiveFile
58-
runImage = "paketobuildpacks/ubuntu-noble-run:latest"
58+
runImage = "paketobuildpacks/ubuntu-resolute-run:latest"
5959
environment = ['BP_JVM_VERSION': java.targetCompatibility.getMajorVersion()]
6060
}

system-test/spring-boot-image-system-tests/src/systemTest/resources/org/springframework/boot/image/paketo/PaketoBuilderTests-plainWarApp.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ war {
4747

4848
bootBuildImage {
4949
archiveFile = war.archiveFile
50-
runImage = "paketobuildpacks/ubuntu-noble-run:latest"
50+
runImage = "paketobuildpacks/ubuntu-resolute-run:latest"
5151
environment = [
5252
'BP_JVM_VERSION': java.targetCompatibility.getMajorVersion(),
5353
'BP_TOMCAT_VERSION': '11.*',

0 commit comments

Comments
 (0)