From eb45aab7120d6cc8d8085b4a4cb71d141066a704 Mon Sep 17 00:00:00 2001 From: Scott Frederick Date: Mon, 7 Aug 2023 13:19:24 -0500 Subject: [PATCH] Upgrade default CNB builders to Paketo Jammy Closes gh-36689 --- ci/pipeline.yml | 4 ++-- .../native-image/developing-your-first-application.adoc | 4 ++-- .../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 +- .../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, 15 insertions(+), 13 deletions(-) diff --git a/ci/pipeline.yml b/ci/pipeline.yml index ad367a8ad4..77cc81ecbc 100644 --- a/ci/pipeline.yml +++ b/ci/pipeline.yml @@ -185,8 +185,8 @@ resources: type: registry-image icon: docker source: - repository: paketobuildpacks/builder - tag: base + repository: paketobuildpacks/builder-jammy-base + tag: latest - 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..fe5a0d5683 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,8 +32,8 @@ 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`. -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. +NOTE: The builder used for the images is `paketobuildpacks/builder-jammy-tiny:latest`. +It has small footprint and reduced attack surface, but you can also use `paketobuildpacks/builder-jammy-base:latest` or `paketobuildpacks/builder-jammy-full:latest` 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..32d88db769 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:latest"); 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..f409fcc875 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:latest"; 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..501d4f12d4 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:latest` or `paketobuildpacks/builder-jammy-tiny:latest` 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..bfb245f2d4 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:latest` 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 061d073e61..7c3ead680b 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 @@ -114,7 +114,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:latest"); 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..0abcd2303d 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:latest` | `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();