From 6506208d291e657e1ec5c4948d8a2054995b8b7f Mon Sep 17 00:00:00 2001 From: Scott Frederick Date: Wed, 2 Aug 2023 19:06:16 -0500 Subject: [PATCH] Upgrade default CNB builders to Paketo Jammy Closes gh-36689 --- ci/pipeline.yml | 3 +-- .../native-image/developing-your-first-application.adoc | 2 +- .../spring-boot-starter-parent/build.gradle | 2 +- .../boot/buildpack/platform/build/BuildRequest.java | 2 +- .../src/docs/asciidoc/packaging-oci-image.adoc | 2 +- .../spring-boot-gradle-plugin/src/docs/asciidoc/reacting.adoc | 2 +- .../boot/gradle/plugin/NativeImagePluginAction.java | 2 +- .../gradle/plugin/NativeImagePluginActionIntegrationTests.java | 3 ++- .../boot/gradle/tasks/bundling/BootBuildImageTests.java | 3 ++- .../src/docs/asciidoc/packaging-oci-image.adoc | 2 +- .../test/java/org/springframework/boot/maven/ImageTests.java | 2 +- 11 files changed, 13 insertions(+), 12 deletions(-) diff --git a/ci/pipeline.yml b/ci/pipeline.yml index ad367a8ad4..4cdfaf3123 100644 --- a/ci/pipeline.yml +++ b/ci/pipeline.yml @@ -185,8 +185,7 @@ resources: type: registry-image icon: docker source: - repository: paketobuildpacks/builder - tag: base + repository: paketobuildpacks/builder-jammy-base - name: artifactory-repo type: artifactory-resource icon: package-variant diff --git a/spring-boot-project/spring-boot-docs/src/docs/asciidoc/native-image/developing-your-first-application.adoc b/spring-boot-project/spring-boot-docs/src/docs/asciidoc/native-image/developing-your-first-application.adoc index b4e70ac86c..a1e47a36b7 100644 --- a/spring-boot-project/spring-boot-docs/src/docs/asciidoc/native-image/developing-your-first-application.adoc +++ b/spring-boot-project/spring-boot-docs/src/docs/asciidoc/native-image/developing-your-first-application.adoc @@ -32,7 +32,7 @@ This means you can just type a single command and quickly get a sensible image i The resulting image doesn't contain a JVM, instead the native image is compiled statically. This leads to smaller images. -NOTE: The builder used for the images is `paketobuildpacks/builder:tiny`. +NOTE: The builder used for the images is `paketobuildpacks/builder-jammy-tiny`. It has small footprint and reduced attack surface, but you can also use `paketobuildpacks/builder-jammy-base` or `paketobuildpacks/builder-jammy-full` to have more tools available in the image if required. diff --git a/spring-boot-project/spring-boot-starters/spring-boot-starter-parent/build.gradle b/spring-boot-project/spring-boot-starters/spring-boot-starter-parent/build.gradle index 2b2028ea2c..713f3ddd78 100644 --- a/spring-boot-project/spring-boot-starters/spring-boot-starter-parent/build.gradle +++ b/spring-boot-project/spring-boot-starters/spring-boot-starter-parent/build.gradle @@ -249,7 +249,7 @@ publishing.publications.withType(MavenPublication) { delegate.artifactId('spring-boot-maven-plugin') configuration { image { - delegate.builder("paketobuildpacks/builder:tiny"); + delegate.builder("paketobuildpacks/builder-jammy-tiny"); env { delegate.BP_NATIVE_IMAGE("true") } diff --git a/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/main/java/org/springframework/boot/buildpack/platform/build/BuildRequest.java b/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/main/java/org/springframework/boot/buildpack/platform/build/BuildRequest.java index 0bb75fe17e..5596b0badb 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/main/java/org/springframework/boot/buildpack/platform/build/BuildRequest.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/main/java/org/springframework/boot/buildpack/platform/build/BuildRequest.java @@ -45,7 +45,7 @@ import org.springframework.util.Assert; */ public class BuildRequest { - static final String DEFAULT_BUILDER_IMAGE_NAME = "paketobuildpacks/builder:base"; + static final String DEFAULT_BUILDER_IMAGE_NAME = "paketobuildpacks/builder-jammy-base"; private static final ImageReference DEFAULT_BUILDER = ImageReference.of(DEFAULT_BUILDER_IMAGE_NAME); diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/asciidoc/packaging-oci-image.adoc b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/asciidoc/packaging-oci-image.adoc index 824c79ee00..b5df977ed5 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/asciidoc/packaging-oci-image.adoc +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/asciidoc/packaging-oci-image.adoc @@ -115,7 +115,7 @@ The following table summarizes the available properties and their default values | `builder` | `--builder` | Name of the Builder image to use. -| `paketobuildpacks/builder:base` or `paketobuildpacks/builder:tiny` when {nbt-gradle-plugin}[GraalVM Native Image plugin] is applied. +| `paketobuildpacks/builder-jammy-base` or `paketobuildpacks/builder-jammy-tiny` when {nbt-gradle-plugin}[GraalVM Native Image plugin] is applied. | `runImage` | `--runImage` diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/asciidoc/reacting.adoc b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/asciidoc/reacting.adoc index 660404b1a4..468002d26c 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/asciidoc/reacting.adoc +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/asciidoc/reacting.adoc @@ -81,6 +81,6 @@ When the {nbt-gradle-plugin}[GraalVM Native Image plugin] is applied to a projec . Configures the GraalVM extension to disable Toolchain detection. . Configures each GraalVM native binary to require GraalVM 22.3 or later. . Configures the `bootJar` task to include the reachability metadata produced by the `collectReachabilityMetadata` task in its jar. -. Configures the `bootBuildImage` task to use `paketobuildpacks/builder:tiny` as its builder and to set `BP_NATIVE_IMAGE` to `true` in its environment. +. Configures the `bootBuildImage` task to use `paketobuildpacks/builder-jammy-tiny` as its builder and to set `BP_NATIVE_IMAGE` to `true` in its environment. diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/java/org/springframework/boot/gradle/plugin/NativeImagePluginAction.java b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/java/org/springframework/boot/gradle/plugin/NativeImagePluginAction.java index 3cc2bf7b2b..fa0b967e61 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/java/org/springframework/boot/gradle/plugin/NativeImagePluginAction.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/java/org/springframework/boot/gradle/plugin/NativeImagePluginAction.java @@ -115,7 +115,7 @@ class NativeImagePluginAction implements PluginApplicationAction { project.getTasks() .named(SpringBootPlugin.BOOT_BUILD_IMAGE_TASK_NAME, BootBuildImage.class) .configure((bootBuildImage) -> { - bootBuildImage.getBuilder().convention("paketobuildpacks/builder:tiny"); + bootBuildImage.getBuilder().convention("paketobuildpacks/builder-jammy-tiny"); bootBuildImage.getEnvironment().put("BP_NATIVE_IMAGE", "true"); }); } diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/java/org/springframework/boot/gradle/plugin/NativeImagePluginActionIntegrationTests.java b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/java/org/springframework/boot/gradle/plugin/NativeImagePluginActionIntegrationTests.java index 08c094e2ef..4d15614a70 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/java/org/springframework/boot/gradle/plugin/NativeImagePluginActionIntegrationTests.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/java/org/springframework/boot/gradle/plugin/NativeImagePluginActionIntegrationTests.java @@ -93,7 +93,8 @@ class NativeImagePluginActionIntegrationTests { writeDummySpringApplicationAotProcessorMainClass(); BuildResult result = this.gradleBuild.expectDeprecationWarningsWithAtLeastVersion("8.2-rc-1") .build("bootBuildImageConfiguration"); - assertThat(result.getOutput()).contains("paketobuildpacks/builder:tiny").contains("BP_NATIVE_IMAGE = true"); + assertThat(result.getOutput()).contains("paketobuildpacks/builder-jammy-tiny") + .contains("BP_NATIVE_IMAGE = true"); } @TestTemplate diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/java/org/springframework/boot/gradle/tasks/bundling/BootBuildImageTests.java b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/java/org/springframework/boot/gradle/tasks/bundling/BootBuildImageTests.java index fdb69d2a53..33dac8a784 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/java/org/springframework/boot/gradle/tasks/bundling/BootBuildImageTests.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/java/org/springframework/boot/gradle/tasks/bundling/BootBuildImageTests.java @@ -171,7 +171,8 @@ class BootBuildImageTests { @Test void whenNoBuilderIsConfiguredThenRequestHasDefaultBuilder() { - assertThat(this.buildImage.createRequest().getBuilder().getName()).isEqualTo("paketobuildpacks/builder"); + assertThat(this.buildImage.createRequest().getBuilder().getName()) + .isEqualTo("paketobuildpacks/builder-jammy-base"); } @Test diff --git a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/docs/asciidoc/packaging-oci-image.adoc b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/docs/asciidoc/packaging-oci-image.adoc index 09e85abb82..7f76bfde23 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/docs/asciidoc/packaging-oci-image.adoc +++ b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/docs/asciidoc/packaging-oci-image.adoc @@ -131,7 +131,7 @@ The following table summarizes the available parameters and their default values | `builder` + (`spring-boot.build-image.builder`) | Name of the Builder image to use. -| `paketobuildpacks/builder:base` +| `paketobuildpacks/builder-jammy-base` | `runImage` + (`spring-boot.build-image.runImage`) diff --git a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/test/java/org/springframework/boot/maven/ImageTests.java b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/test/java/org/springframework/boot/maven/ImageTests.java index 8f3558701c..86625106bd 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/test/java/org/springframework/boot/maven/ImageTests.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/test/java/org/springframework/boot/maven/ImageTests.java @@ -67,7 +67,7 @@ class ImageTests { void getBuildRequestWhenNoCustomizationsUsesDefaults() { BuildRequest request = new Image().getBuildRequest(createArtifact(), mockApplicationContent()); assertThat(request.getName()).hasToString("docker.io/library/my-app:0.0.1-SNAPSHOT"); - assertThat(request.getBuilder().toString()).contains("paketobuildpacks/builder"); + assertThat(request.getBuilder().toString()).contains("paketobuildpacks/builder-jammy-base"); assertThat(request.getRunImage()).isNull(); assertThat(request.getEnv()).isEmpty(); assertThat(request.isCleanCache()).isFalse();