This commit adds a runImage property to the Maven plugin build-image
goal and the Gradle bootBuildImage task. The property allows the user
to override the run image reference provided in the builder metadata
with an alternate run image. The runImage property can be specified
in the build file or on the command line.
Fixes gh-21534
| No default value, indicating the run image specified in Builder metadata should be used.
| `imageName`
| `--imageName`
| {spring-boot-api}/buildpack/platform/docker/type/ImageReference.html#of-java.lang.String-[Image name] for the generated image.
@ -79,8 +84,8 @@ The following table summarizes the available properties and their default values
[[build-image-example-custom-image-builder]]
==== Custom Image Builder
If you need to customize the builder used to create the image, configure the task as shown in the following example:
==== Custom Image Builder and Run Image
If you need to customize the builder used to create the image or the run image used to launch the built image, configure the task as shown in the following example:
This configuration will use a builder image with the name `mine/java-cnb-builder` and the tag `latest`.
This configuration will use a builder image with the name `mine/java-cnb-builder` and the tag `latest`, and the run image named `mine/java-cnb-run` and the tag `latest`.
The builder can be specified on the command line as well, as shown in this example:
The builder and run image can be specified on the command line as well, as shown in this example:
If you need to customize the builder used to create the image, configure the plugin as shown in the following example:
If you need to customize the builder used to create the image or the run image used to launch the built image, configure the plugin as shown in the following example:
[source,xml,indent=0,subs="verbatim,attributes"]
----
@ -123,6 +128,7 @@ If you need to customize the builder used to create the image, configure the plu
<configuration>
<image>
<builder>mine/java-cnb-builder</builder>
<runImage>mine/java-cnb-run</runImage>
</image>
</configuration>
</plugin>
@ -131,13 +137,13 @@ If you need to customize the builder used to create the image, configure the plu
</project>
----
This configuration will use a builder image with the name `mine/java-cnb-builder` and the tag `latest`.
This configuration will use a builder image with the name `mine/java-cnb-builder` and the tag `latest`, and the run image named `mine/java-cnb-run` and the tag `latest`.
The builder can be specified on the command line as well, as shown in this example:
The builder and run image can be specified on the command line as well, as shown in this example: