From 461dc23c0c530af2708fed42179e6900f4b56791 Mon Sep 17 00:00:00 2001 From: Emily Casey Date: Fri, 9 Oct 2020 15:36:46 -0400 Subject: [PATCH 1/2] Update default builder image This commit updates the default builder image used by the Maven and Gradle plugins image-building goal and task to use the latest Paketo builder image. The builder image is pulled from Docker Hub instead of Google Container Registry by default. See gh-23628 --- .../buildpack/platform/build/BuildRequest.java | 2 +- .../src/docs/asciidoc/packaging-oci-image.adoc | 2 +- .../src/docs/asciidoc/packaging-oci-image.adoc | 2 +- .../boot/maven/BuildImageTests.java | 16 ++++++++-------- .../projects/build-image-custom-builder/pom.xml | 4 ++-- .../springframework/boot/maven/ImageTests.java | 2 +- 6 files changed, 14 insertions(+), 14 deletions(-) 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 c4ccd59916..fc6b744e23 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 @@ -37,7 +37,7 @@ import org.springframework.util.Assert; */ public class BuildRequest { - static final String DEFAULT_BUILDER_IMAGE_NAME = "gcr.io/paketo-buildpacks/builder:base-platform-api-0.3"; + static final String DEFAULT_BUILDER_IMAGE_NAME = "paketobuildpacks/builder: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 2770f95bbd..9574dc3632 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 @@ -105,7 +105,7 @@ The following table summarizes the available properties and their default values | `builder` | `--builder` | Name of the Builder image to use. -| `gcr.io/paketo-buildpacks/builder:base-platform-api-0.3` +| `paketobuildpacks/builder:base` | `runImage` | `--runImage` 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 02506d1f9f..8d73975cc1 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 @@ -128,7 +128,7 @@ The following table summarizes the available parameters and their default values | `builder` | Name of the Builder image to use. | `spring-boot.build-image.builder` -| `gcr.io/paketo-buildpacks/builder:base-platform-api-0.3` +| `paketobuildpacks/builder:base` | `runImage` | Name of the run image to use. diff --git a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/java/org/springframework/boot/maven/BuildImageTests.java b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/java/org/springframework/boot/maven/BuildImageTests.java index e1a2cc193b..94cbe32c1d 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/java/org/springframework/boot/maven/BuildImageTests.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/java/org/springframework/boot/maven/BuildImageTests.java @@ -52,7 +52,7 @@ public class BuildImageTests extends AbstractArchiveIntegrationTests { assertThat(jar).isFile(); File original = new File(project, "target/build-image-0.0.1.BUILD-SNAPSHOT.jar.original"); assertThat(original).doesNotExist(); - assertThat(buildLog(project)).contains("Building image").contains("paketo-buildpacks/builder") + assertThat(buildLog(project)).contains("Building image").contains("paketobuildpacks/builder") .contains("docker.io/library/build-image:0.0.1.BUILD-SNAPSHOT") .contains("Successfully built image"); ImageReference imageReference = ImageReference.of(ImageName.of("build-image"), "0.0.1.BUILD-SNAPSHOT"); @@ -94,13 +94,13 @@ public class BuildImageTests extends AbstractArchiveIntegrationTests { mavenBuild.project("build-image").goals("package") .systemProperty("spring-boot.build-image.imageName", "example.com/test/cmd-property-name:v1") .systemProperty("spring-boot.build-image.builder", - "gcr.io/paketo-buildpacks/builder:full-cf-platform-api-0.3") - .systemProperty("spring-boot.build-image.runImage", "gcr.io/paketo-buildpacks/run:full-cnb-cf") + "paketobuildpacks/builder:full") + .systemProperty("spring-boot.build-image.runImage", "paketobuildpacks/run:full-cnb") .execute((project) -> { assertThat(buildLog(project)).contains("Building image") .contains("example.com/test/cmd-property-name:v1") - .contains("paketo-buildpacks/builder:full-cf-platform-api-0.3") - .contains("paketo-buildpacks/run:full-cnb-cf").contains("Successfully built image"); + .contains("paketobuildpacks/builder:full") + .contains("paketobuildpacks/run:full-cnb").contains("Successfully built image"); ImageReference imageReference = ImageReference.of("example.com/test/cmd-property-name:v1"); try (GenericContainer container = new GenericContainer<>(imageReference.toString())) { container.waitingFor(Wait.forLogMessage("Launched\\n", 1)).start(); @@ -115,8 +115,8 @@ public class BuildImageTests extends AbstractArchiveIntegrationTests { void whenBuildImageIsInvokedWithCustomBuilderImageAndRunImage(MavenBuild mavenBuild) { mavenBuild.project("build-image-custom-builder").goals("package").execute((project) -> { assertThat(buildLog(project)).contains("Building image") - .contains("paketo-buildpacks/builder:full-cf-platform-api-0.3") - .contains("paketo-buildpacks/run:full-cnb-cf") + .contains("paketobuildpacks/builder:full") + .contains("paketobuildpacks/run:full-cnb") .contains("docker.io/library/build-image-v2-builder:0.0.1.BUILD-SNAPSHOT") .contains("Successfully built image"); ImageReference imageReference = ImageReference @@ -134,7 +134,7 @@ public class BuildImageTests extends AbstractArchiveIntegrationTests { void whenBuildImageIsInvokedWithEmptyEnvEntry(MavenBuild mavenBuild) { mavenBuild.project("build-image-empty-env-entry").goals("package").prepare(this::writeLongNameResource) .execute((project) -> { - assertThat(buildLog(project)).contains("Building image").contains("paketo-buildpacks/builder") + assertThat(buildLog(project)).contains("Building image").contains("paketobuildpacks/builder") .contains("docker.io/library/build-image-empty-env-entry:0.0.1.BUILD-SNAPSHOT") .contains("Successfully built image"); ImageReference imageReference = ImageReference.of(ImageName.of("build-image-empty-env-entry"), diff --git a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/projects/build-image-custom-builder/pom.xml b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/projects/build-image-custom-builder/pom.xml index 7b37388b62..457cb7c933 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/projects/build-image-custom-builder/pom.xml +++ b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/projects/build-image-custom-builder/pom.xml @@ -23,8 +23,8 @@ - gcr.io/paketo-buildpacks/builder:full-cf-platform-api-0.3 - gcr.io/paketo-buildpacks/run:full-cnb-cf + paketobuildpacks/builder:full + paketobuildpacks/run:full-cnb 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 7852775783..64c901fafe 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 @@ -59,7 +59,7 @@ class ImageTests { void getBuildRequestWhenNoCustomizationsUsesDefaults() { BuildRequest request = new Image().getBuildRequest(createArtifact(), mockApplicationContent()); assertThat(request.getName().toString()).isEqualTo("docker.io/library/my-app:0.0.1-SNAPSHOT"); - assertThat(request.getBuilder().toString()).contains("paketo-buildpacks/builder"); + assertThat(request.getBuilder().toString()).contains("paketobuildpacks/builder"); assertThat(request.getRunImage()).isNull(); assertThat(request.getEnv()).isEmpty(); assertThat(request.isCleanCache()).isFalse(); From 0e7ab88491f4275277a5799238a71f5a9daafb2b Mon Sep 17 00:00:00 2001 From: Scott Frederick Date: Mon, 12 Oct 2020 16:32:51 -0500 Subject: [PATCH 2/2] Polish "Update default builder image" See gh-23628 --- .../platform/build/BuildRequestTests.java | 4 ++-- .../bundling/BootBuildImageIntegrationTests.java | 15 +++++++-------- .../tasks/bundling/BootBuildImageTests.java | 2 +- ...buildsImageWithCustomBuilderAndRunImage.gradle | 4 ++-- .../boot/maven/BuildImageTests.java | 13 +++++-------- 5 files changed, 17 insertions(+), 21 deletions(-) diff --git a/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/test/java/org/springframework/boot/buildpack/platform/build/BuildRequestTests.java b/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/test/java/org/springframework/boot/buildpack/platform/build/BuildRequestTests.java index ccd42bc897..e78ff3145e 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/test/java/org/springframework/boot/buildpack/platform/build/BuildRequestTests.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/test/java/org/springframework/boot/buildpack/platform/build/BuildRequestTests.java @@ -55,7 +55,7 @@ public class BuildRequestTests { writeTestJarFile(jarFile); BuildRequest request = BuildRequest.forJarFile(jarFile); assertThat(request.getName().toString()).isEqualTo("docker.io/library/my-app:0.0.1"); - assertThat(request.getBuilder().toString()).isEqualTo(BuildRequest.DEFAULT_BUILDER_IMAGE_NAME); + assertThat(request.getBuilder().toString()).isEqualTo("docker.io/" + BuildRequest.DEFAULT_BUILDER_IMAGE_NAME); assertThat(request.getApplicationContent(Owner.ROOT)).satisfies(this::hasExpectedJarContent); assertThat(request.getEnv()).isEmpty(); } @@ -66,7 +66,7 @@ public class BuildRequestTests { writeTestJarFile(jarFile); BuildRequest request = BuildRequest.forJarFile(ImageReference.of("test-app"), jarFile); assertThat(request.getName().toString()).isEqualTo("docker.io/library/test-app:latest"); - assertThat(request.getBuilder().toString()).isEqualTo(BuildRequest.DEFAULT_BUILDER_IMAGE_NAME); + assertThat(request.getBuilder().toString()).isEqualTo("docker.io/" + BuildRequest.DEFAULT_BUILDER_IMAGE_NAME); assertThat(request.getApplicationContent(Owner.ROOT)).satisfies(this::hasExpectedJarContent); assertThat(request.getEnv()).isEmpty(); } diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/java/org/springframework/boot/gradle/tasks/bundling/BootBuildImageIntegrationTests.java b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/java/org/springframework/boot/gradle/tasks/bundling/BootBuildImageIntegrationTests.java index 78603805b5..f4f1888214 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/java/org/springframework/boot/gradle/tasks/bundling/BootBuildImageIntegrationTests.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/java/org/springframework/boot/gradle/tasks/bundling/BootBuildImageIntegrationTests.java @@ -60,7 +60,7 @@ class BootBuildImageIntegrationTests { String projectName = this.gradleBuild.getProjectDir().getName(); assertThat(result.task(":bootBuildImage").getOutcome()).isEqualTo(TaskOutcome.SUCCESS); assertThat(result.getOutput()).contains("docker.io/library/" + projectName); - assertThat(result.getOutput()).contains("paketo-buildpacks/builder"); + assertThat(result.getOutput()).contains("paketobuildpacks/builder"); ImageReference imageReference = ImageReference.of(ImageName.of(projectName)); try (GenericContainer container = new GenericContainer<>(imageReference.toString())) { container.waitingFor(Wait.forLogMessage("Launched\\n", 1)).start(); @@ -77,7 +77,7 @@ class BootBuildImageIntegrationTests { BuildResult result = this.gradleBuild.build("bootBuildImage"); assertThat(result.task(":bootBuildImage").getOutcome()).isEqualTo(TaskOutcome.SUCCESS); assertThat(result.getOutput()).contains("example/test-image-name"); - assertThat(result.getOutput()).contains("paketo-buildpacks/builder"); + assertThat(result.getOutput()).contains("paketobuildpacks/builder"); ImageReference imageReference = ImageReference.of(ImageName.of("example/test-image-name")); try (GenericContainer container = new GenericContainer<>(imageReference.toString())) { container.waitingFor(Wait.forLogMessage("Launched\\n", 1)).start(); @@ -94,8 +94,8 @@ class BootBuildImageIntegrationTests { BuildResult result = this.gradleBuild.build("bootBuildImage"); assertThat(result.task(":bootBuildImage").getOutcome()).isEqualTo(TaskOutcome.SUCCESS); assertThat(result.getOutput()).contains("example/test-image-custom"); - assertThat(result.getOutput()).contains("paketo-buildpacks/builder:full-cf-platform-api-0.3"); - assertThat(result.getOutput()).contains("paketo-buildpacks/run:full-cnb-cf"); + assertThat(result.getOutput()).contains("paketobuildpacks/builder:full"); + assertThat(result.getOutput()).contains("paketobuildpacks/run:full"); ImageReference imageReference = ImageReference.of(ImageName.of("example/test-image-custom")); try (GenericContainer container = new GenericContainer<>(imageReference.toString())) { container.waitingFor(Wait.forLogMessage("Launched\\n", 1)).start(); @@ -110,12 +110,11 @@ class BootBuildImageIntegrationTests { writeMainClass(); writeLongNameResource(); BuildResult result = this.gradleBuild.build("bootBuildImage", "--imageName=example/test-image-cmd", - "--builder=gcr.io/paketo-buildpacks/builder:full-cf-platform-api-0.3", - "--runImage=gcr.io/paketo-buildpacks/run:full-cnb-cf"); + "--builder=paketobuildpacks/builder:full", "--runImage=paketobuildpacks/run:full-cnb"); assertThat(result.task(":bootBuildImage").getOutcome()).isEqualTo(TaskOutcome.SUCCESS); assertThat(result.getOutput()).contains("example/test-image-cmd"); - assertThat(result.getOutput()).contains("paketo-buildpacks/builder:full-cf-platform-api-0.3"); - assertThat(result.getOutput()).contains("paketo-buildpacks/run:full-cnb-cf"); + assertThat(result.getOutput()).contains("paketobuildpacks/builder:full"); + assertThat(result.getOutput()).contains("paketobuildpacks/run:full"); ImageReference imageReference = ImageReference.of(ImageName.of("example/test-image-cmd")); try (GenericContainer container = new GenericContainer<>(imageReference.toString())) { container.waitingFor(Wait.forLogMessage("Launched\\n", 1)).start(); 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 8d3159f0a9..293cd66a14 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 @@ -190,7 +190,7 @@ class BootBuildImageTests { @Test void whenNoBuilderIsConfiguredThenRequestHasDefaultBuilder() { - assertThat(this.buildImage.createRequest().getBuilder().getName()).isEqualTo("paketo-buildpacks/builder"); + assertThat(this.buildImage.createRequest().getBuilder().getName()).isEqualTo("paketobuildpacks/builder"); } @Test diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/tasks/bundling/BootBuildImageIntegrationTests-buildsImageWithCustomBuilderAndRunImage.gradle b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/tasks/bundling/BootBuildImageIntegrationTests-buildsImageWithCustomBuilderAndRunImage.gradle index 56e5bce571..9878fe16db 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/tasks/bundling/BootBuildImageIntegrationTests-buildsImageWithCustomBuilderAndRunImage.gradle +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/tasks/bundling/BootBuildImageIntegrationTests-buildsImageWithCustomBuilderAndRunImage.gradle @@ -8,6 +8,6 @@ targetCompatibility = '1.8' bootBuildImage { imageName = "example/test-image-custom" - builder = "gcr.io/paketo-buildpacks/builder:full-cf-platform-api-0.3" - runImage = "gcr.io/paketo-buildpacks/run:full-cnb-cf" + builder = "paketobuildpacks/builder:full" + runImage = "paketobuildpacks/run:full-cnb" } diff --git a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/java/org/springframework/boot/maven/BuildImageTests.java b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/java/org/springframework/boot/maven/BuildImageTests.java index 94cbe32c1d..aa86ae63f8 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/java/org/springframework/boot/maven/BuildImageTests.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/java/org/springframework/boot/maven/BuildImageTests.java @@ -93,14 +93,12 @@ public class BuildImageTests extends AbstractArchiveIntegrationTests { void whenBuildImageIsInvokedWithCommandLineParameters(MavenBuild mavenBuild) { mavenBuild.project("build-image").goals("package") .systemProperty("spring-boot.build-image.imageName", "example.com/test/cmd-property-name:v1") - .systemProperty("spring-boot.build-image.builder", - "paketobuildpacks/builder:full") + .systemProperty("spring-boot.build-image.builder", "paketobuildpacks/builder:full") .systemProperty("spring-boot.build-image.runImage", "paketobuildpacks/run:full-cnb") .execute((project) -> { assertThat(buildLog(project)).contains("Building image") - .contains("example.com/test/cmd-property-name:v1") - .contains("paketobuildpacks/builder:full") - .contains("paketobuildpacks/run:full-cnb").contains("Successfully built image"); + .contains("example.com/test/cmd-property-name:v1").contains("paketobuildpacks/builder:full") + .contains("paketobuildpacks/run:full").contains("Successfully built image"); ImageReference imageReference = ImageReference.of("example.com/test/cmd-property-name:v1"); try (GenericContainer container = new GenericContainer<>(imageReference.toString())) { container.waitingFor(Wait.forLogMessage("Launched\\n", 1)).start(); @@ -114,9 +112,8 @@ public class BuildImageTests extends AbstractArchiveIntegrationTests { @TestTemplate void whenBuildImageIsInvokedWithCustomBuilderImageAndRunImage(MavenBuild mavenBuild) { mavenBuild.project("build-image-custom-builder").goals("package").execute((project) -> { - assertThat(buildLog(project)).contains("Building image") - .contains("paketobuildpacks/builder:full") - .contains("paketobuildpacks/run:full-cnb") + assertThat(buildLog(project)).contains("Building image").contains("paketobuildpacks/builder:full") + .contains("paketobuildpacks/run:full") .contains("docker.io/library/build-image-v2-builder:0.0.1.BUILD-SNAPSHOT") .contains("Successfully built image"); ImageReference imageReference = ImageReference