Upgrade default CNB builders to Paketo Jammy

Closes gh-36689
pull/37013/head
Scott Frederick 1 year ago
parent 2ef2529c93
commit eb45aab712

@ -185,8 +185,8 @@ resources:
type: registry-image type: registry-image
icon: docker icon: docker
source: source:
repository: paketobuildpacks/builder repository: paketobuildpacks/builder-jammy-base
tag: base tag: latest
- name: artifactory-repo - name: artifactory-repo
type: artifactory-resource type: artifactory-resource
icon: package-variant icon: package-variant

@ -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. The resulting image doesn't contain a JVM, instead the native image is compiled statically.
This leads to smaller images. 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:latest`.
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. 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.

@ -249,7 +249,7 @@ publishing.publications.withType(MavenPublication) {
delegate.artifactId('spring-boot-maven-plugin') delegate.artifactId('spring-boot-maven-plugin')
configuration { configuration {
image { image {
delegate.builder("paketobuildpacks/builder:tiny"); delegate.builder("paketobuildpacks/builder-jammy-tiny:latest");
env { env {
delegate.BP_NATIVE_IMAGE("true") delegate.BP_NATIVE_IMAGE("true")
} }

@ -45,7 +45,7 @@ import org.springframework.util.Assert;
*/ */
public class BuildRequest { 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); private static final ImageReference DEFAULT_BUILDER = ImageReference.of(DEFAULT_BUILDER_IMAGE_NAME);

@ -115,7 +115,7 @@ The following table summarizes the available properties and their default values
| `builder` | `builder`
| `--builder` | `--builder`
| Name of the Builder image to use. | 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`
| `--runImage` | `--runImage`

@ -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 the GraalVM extension to disable Toolchain detection.
. Configures each GraalVM native binary to require GraalVM 22.3 or later. . 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 `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.

@ -114,7 +114,7 @@ class NativeImagePluginAction implements PluginApplicationAction {
project.getTasks() project.getTasks()
.named(SpringBootPlugin.BOOT_BUILD_IMAGE_TASK_NAME, BootBuildImage.class) .named(SpringBootPlugin.BOOT_BUILD_IMAGE_TASK_NAME, BootBuildImage.class)
.configure((bootBuildImage) -> { .configure((bootBuildImage) -> {
bootBuildImage.getBuilder().convention("paketobuildpacks/builder:tiny"); bootBuildImage.getBuilder().convention("paketobuildpacks/builder-jammy-tiny:latest");
bootBuildImage.getEnvironment().put("BP_NATIVE_IMAGE", "true"); bootBuildImage.getEnvironment().put("BP_NATIVE_IMAGE", "true");
}); });
} }

@ -93,7 +93,8 @@ class NativeImagePluginActionIntegrationTests {
writeDummySpringApplicationAotProcessorMainClass(); writeDummySpringApplicationAotProcessorMainClass();
BuildResult result = this.gradleBuild.expectDeprecationWarningsWithAtLeastVersion("8.2-rc-1") BuildResult result = this.gradleBuild.expectDeprecationWarningsWithAtLeastVersion("8.2-rc-1")
.build("bootBuildImageConfiguration"); .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 @TestTemplate

@ -171,7 +171,8 @@ class BootBuildImageTests {
@Test @Test
void whenNoBuilderIsConfiguredThenRequestHasDefaultBuilder() { void whenNoBuilderIsConfiguredThenRequestHasDefaultBuilder() {
assertThat(this.buildImage.createRequest().getBuilder().getName()).isEqualTo("paketobuildpacks/builder"); assertThat(this.buildImage.createRequest().getBuilder().getName())
.isEqualTo("paketobuildpacks/builder-jammy-base");
} }
@Test @Test

@ -131,7 +131,7 @@ The following table summarizes the available parameters and their default values
| `builder` + | `builder` +
(`spring-boot.build-image.builder`) (`spring-boot.build-image.builder`)
| Name of the Builder image to use. | Name of the Builder image to use.
| `paketobuildpacks/builder:base` | `paketobuildpacks/builder-jammy-base:latest`
| `runImage` + | `runImage` +
(`spring-boot.build-image.runImage`) (`spring-boot.build-image.runImage`)

@ -67,7 +67,7 @@ class ImageTests {
void getBuildRequestWhenNoCustomizationsUsesDefaults() { void getBuildRequestWhenNoCustomizationsUsesDefaults() {
BuildRequest request = new Image().getBuildRequest(createArtifact(), mockApplicationContent()); BuildRequest request = new Image().getBuildRequest(createArtifact(), mockApplicationContent());
assertThat(request.getName()).hasToString("docker.io/library/my-app:0.0.1-SNAPSHOT"); 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.getRunImage()).isNull();
assertThat(request.getEnv()).isEmpty(); assertThat(request.getEnv()).isEmpty();
assertThat(request.isCleanCache()).isFalse(); assertThat(request.isCleanCache()).isFalse();

Loading…
Cancel
Save