Skip to content

Commit 49b0707

Browse files
Clarify image builder configuration documentation
This commit qualifies examples of configuring the CNB builder to clarify that the examples apply to use of the default Paketo builder, and adds links to the official Paketo docs for more details. Fixes gh-19967
1 parent 0709c76 commit 49b0707

File tree

4 files changed

+20
-14
lines changed

4 files changed

+20
-14
lines changed

spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/asciidoc/index.adoc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ Andy Wilkinson, Scott Frederick
3434
:boot-run-javadoc: {api-documentation}/org/springframework/boot/gradle/tasks/run/BootRun.html
3535
:github-code: https://github.com/spring-projects/spring-boot/tree/{github-tag}
3636
:buildpacks-reference: https://buildpacks.io/docs
37+
:paketo-java-reference: https://paketo.io/docs/buildpacks/language-family-buildpacks/java
3738

3839

3940
[[introduction]]

spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/asciidoc/packaging-oci-image.adoc

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
[[build-image]]
22
== Packaging OCI Images
3-
The plugin can create an https://github.com/opencontainers/image-spec[OCI image] from executable jars using https://buildpacks.io[Cloud Native Buildpacks].
3+
The plugin can create an https://github.com/opencontainers/image-spec[OCI image] from executable jars using https://buildpacks.io[Cloud Native Buildpacks] (CNB).
44
Images can be built using the `bootBuildImage` task.
55

6-
NOTE: For security reasons, images build and run as non-root users, see https://buildpacks.io/docs/reference/spec/platform-api/#users[this section fore more details].
6+
NOTE: For security reasons, images build and run as non-root users.
7+
See the {buildpacks-reference}/reference/spec/platform-api/#users[CNB specification] for more details.
78

89
The task is automatically created when the `java` plugin is applied and is an instance of {boot-build-image-javadoc}[`BootBuildImage`].
910

@@ -81,8 +82,8 @@ The following table summarizes the available properties and their default values
8182
|===
8283

8384
NOTE: The plugin detects the target Java compatibility of the project using the JavaPlugin's `targetCompatibility` property.
84-
By default, the plugin instructs the buildpacks to install the same Java version.
85-
You can override this behaviour by setting the `BP_JVM_VERSION` environment variable, see <<build-image-example-builder-configuration,builder configuration>>.
85+
When using the default Paketo builder and buildpacks, the plugin instructs the buildpacks to install the same Java version.
86+
You can override this behaviour as shown in the <<build-image-example-builder-configuration,builder configuration>> examples.
8687

8788

8889

@@ -122,8 +123,7 @@ $ gradle bootBuildImage --builder=mine/java-cnb-builder --runImage=mine/java-cnb
122123
==== Builder Configuration
123124
If the builder exposes configuration options, those can be set using the `environment` property.
124125

125-
The following example assumes that the default builder recognizes a `BP_JVM_VERSION` property.
126-
This property is typically used to customize the JDK version the image should use by specifying the major version and a wildcard for the rest of the version:
126+
The following is an example of {paketo-java-reference}/#configuring-the-jvm-version[configuring the JVM version] used by the Paketo Java buildpacks at build time:
127127

128128
[source,groovy,indent=0,subs="verbatim,attributes",role="primary"]
129129
.Groovy
@@ -137,8 +137,10 @@ include::../gradle/packaging/boot-build-image-env.gradle[tags=env]
137137
include::../gradle/packaging/boot-build-image-env.gradle.kts[tags=env]
138138
----
139139

140+
Refer to the {paketo-java-reference}[Paketo documentation] for additional configuration options supported by Paketo Java buildpacks.
141+
140142
If there is a network proxy between the Docker daemon the builder runs in and network locations that buildpacks download artifacts from, you will need to configure the builder to use the proxy.
141-
When using the default builder, this can be accomplished by setting the `HTTPS_PROXY` and/or `HTTP_PROXY` environment variables as show in the following example:
143+
When using the Paketo builder, this can be accomplished by setting the `HTTPS_PROXY` and/or `HTTP_PROXY` environment variables as show in the following example:
142144

143145
[source,groovy,indent=0,subs="verbatim,attributes",role="primary"]
144146
.Groovy

spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/docs/asciidoc/index.adoc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ Stephane Nicoll, Andy Wilkinson, Scott Frederick
1414
:spring-boot-api: {spring-boot-docs}/api/org/springframework/boot
1515
:spring-boot-reference: {spring-boot-docs}/reference/htmlsingle
1616
:version-properties-appendix: {spring-boot-reference}/#dependency-versions-properties
17+
:paketo-java-reference: https://paketo.io/docs/buildpacks/language-family-buildpacks/java
1718

1819

1920
[[introduction]]

spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/docs/asciidoc/packaging-oci-image.adoc

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
[[build-image]]
22
== Packaging OCI Images
3-
The plugin can create an https://github.com/opencontainers/image-spec[OCI image] using https://buildpacks.io/[Cloud Native Buildpacks].
3+
The plugin can create an https://github.com/opencontainers/image-spec[OCI image] using https://buildpacks.io/[Cloud Native Buildpacks] (CNB).
44
Images can be built using the `build-image` goal.
55

6-
NOTE: For security reasons, images build and run as non-root users, see https://buildpacks.io/docs/reference/spec/platform-api/#users[this section fore more details].
6+
NOTE: For security reasons, images build and run as non-root users.
7+
See the {buildpacks-reference}/reference/spec/platform-api/#users[CNB specification] for more details.
78

89
The easiest way to get started is to invoke `mvn spring-boot:build-image` on a project.
910
It is possible to automate the creation of an image whenever the `package` phase is invoked, as shown in the following example:
@@ -104,8 +105,8 @@ The following table summarizes the available parameters and their default values
104105
|===
105106

106107
NOTE: The plugin detects the target Java compatibility of the project using the compiler's plugin configuration or the `maven.compiler.target` property.
107-
By default, the plugin instructs the buildpacks to install the same Java version.
108-
You can override this behaviour by setting the `BP_JVM_VERSION` environment variable, see <<build-image-example-builder-configuration,builder configuration>>.
108+
When using the default Paketo builder and buildpacks, the plugin instructs the buildpacks to install the same Java version.
109+
You can override this behaviour as shown in the <<build-image-example-builder-configuration,builder configuration>> examples.
109110

110111
For more details, see also <<build-image-example-custom-image-builder,custom image builder>> and <<build-image-example-custom-image-name,custom image name>>.
111112

@@ -158,8 +159,7 @@ The builder and run image can be specified on the command line as well, as shown
158159
==== Builder Configuration
159160
If the builder exposes configuration options using environment variables, those can be set using the `env` attributes.
160161

161-
The following example assumes that the default builder recognizes a `BP_JVM_VERSION` property.
162-
This property is typically used to customize the JDK version the image should use by specifying the major version and a wildcard for the rest of the version:
162+
The following is an example of {paketo-java-reference}/#configuring-the-jvm-version[configuring the JVM version] used by the Paketo Java buildpacks at build time:
163163

164164
[source,xml,indent=0,subs="verbatim,attributes"]
165165
----
@@ -183,8 +183,10 @@ This property is typically used to customize the JDK version the image should us
183183
</project>
184184
----
185185

186+
Refer to the {paketo-java-reference}[Paketo documentation] for additional configuration options supported by Paketo Java buildpacks.
187+
186188
If there is a network proxy between the Docker daemon the builder runs in and network locations that buildpacks download artifacts from, you will need to configure the builder to use the proxy.
187-
When using the default builder, this can be accomplished by setting the `HTTPS_PROXY` and/or `HTTP_PROXY` environment variables as show in the following example:
189+
When using the Paketo builder, this can be accomplished by setting the `HTTPS_PROXY` and/or `HTTP_PROXY` environment variables as show in the following example:
188190

189191
[source,xml,indent=0,subs="verbatim,attributes"]
190192
----

0 commit comments

Comments
 (0)