mirror of
https://github.com/spring-projects/spring-boot.git
synced 2024-07-05 00:56:58 +08:00
Merge branch '3.0.x' into 3.1.x
Closes gh-38485
This commit is contained in:
commit
d433deb737
@ -179,8 +179,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
|
||||
|
@ -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.
|
||||
|
||||
|
||||
|
||||
|
@ -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")
|
||||
}
|
||||
|
@ -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);
|
||||
|
||||
|
@ -105,7 +105,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`
|
||||
|
@ -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.
|
||||
|
||||
|
||||
|
@ -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:latest");
|
||||
bootBuildImage.getEnvironment().put("BP_NATIVE_IMAGE", "true");
|
||||
});
|
||||
}
|
||||
|
@ -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:latest")
|
||||
.contains("BP_NATIVE_IMAGE = true");
|
||||
}
|
||||
|
||||
@TestTemplate
|
||||
|
@ -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
|
||||
|
@ -121,7 +121,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`)
|
||||
|
@ -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:latest");
|
||||
assertThat(request.getRunImage()).isNull();
|
||||
assertThat(request.getEnv()).isEmpty();
|
||||
assertThat(request.isCleanCache()).isFalse();
|
||||
|
Loading…
Reference in New Issue
Block a user