2020-01-23 23:35:45 +08:00
[[build-image]]
2021-05-20 12:16:06 +08:00
= Packaging OCI Images
2021-02-25 04:49:22 +08:00
The plugin can create an https://github.com/opencontainers/image-spec[OCI image] from a jar or war file using https://buildpacks.io/[Cloud Native Buildpacks] (CNB).
2022-11-21 20:05:23 +08:00
Images can be built on the command-line using the `build-image` goal.
This makes sure that the package lifecycle has run before the image is created.
2020-01-23 23:35:45 +08:00
2020-10-09 06:02:17 +08:00
NOTE: For security reasons, images build and run as non-root users.
See the {buildpacks-reference}/reference/spec/platform-api/#users[CNB specification] for more details.
2020-09-07 18:41:51 +08:00
2020-02-19 10:16:46 +08:00
The easiest way to get started is to invoke `mvn spring-boot:build-image` on a project.
2020-01-23 23:35:45 +08:00
It is possible to automate the creation of an image whenever the `package` phase is invoked, as shown in the following example:
2021-03-06 10:24:35 +08:00
[source,xml,indent=0,subs="verbatim,attributes",tabsize=4]
2020-01-23 23:35:45 +08:00
----
2021-03-06 10:24:35 +08:00
include::../maven/packaging-oci-image/pom.xml[tags=packaging-oci-image]
2020-01-23 23:35:45 +08:00
----
2022-11-21 20:05:23 +08:00
NOTE: Use `build-image-no-fork` when binding the goal to the package lifecycle.
This goal is similar to `build-image` but does not fork the lifecycle to make sure `package` has run.
In the rest of this section, `build-image` is used to refer to either the `build-image` or `build-image-no-fork` goals.
2021-05-20 12:16:06 +08:00
TIP: While the buildpack runs from an <<packaging,executable archive>>, it is not necessary to execute the `repackage` goal first as the executable archive is created automatically if necessary.
2021-09-28 04:31:05 +08:00
When the `build-image` repackages the application, it applies the same settings as the `repackage` goal would, that is dependencies can be excluded using one of the exclude options, and Devtools is automatically excluded by default (you can control that using the `excludeDevtools` property).
2020-01-23 23:35:45 +08:00
2020-01-31 09:02:47 +08:00
2020-04-01 13:51:16 +08:00
2021-05-20 12:16:06 +08:00
[[build-image.docker-daemon]]
== Docker Daemon
2020-04-01 02:37:55 +08:00
The `build-image` goal requires access to a Docker daemon.
By default, it will communicate with a Docker daemon over a local connection.
This works with https://docs.docker.com/install/[Docker Engine] on all supported platforms without configuration.
2022-03-12 06:39:07 +08:00
Environment variables can be set to configure the `build-image` goal to use an alternative local or remote connection.
2020-04-01 02:37:55 +08:00
The following table shows the environment variables and their values:
|===
| Environment variable | Description
2020-06-12 05:20:39 +08:00
| DOCKER_HOST
2021-09-28 04:31:05 +08:00
| URL containing the host and port for the Docker daemon - for example `tcp://192.168.99.100:2376`
2020-04-01 13:51:16 +08:00
2020-06-12 05:20:39 +08:00
| DOCKER_TLS_VERIFY
2020-04-01 13:51:16 +08:00
| Enable secure HTTPS protocol when set to `1` (optional)
2020-06-12 05:20:39 +08:00
| DOCKER_CERT_PATH
2020-04-01 13:51:16 +08:00
| Path to certificate and key files for HTTPS (required if `DOCKER_TLS_VERIFY=1`, ignored otherwise)
2020-04-01 02:37:55 +08:00
|===
2020-09-18 03:25:18 +08:00
Docker daemon connection information can also be provided using `docker` parameters in the plugin configuration.
The following table summarizes the available parameters:
|===
| Parameter | Description
| `host`
2021-09-28 04:31:05 +08:00
| URL containing the host and port for the Docker daemon - for example `tcp://192.168.99.100:2376`
2020-09-18 03:25:18 +08:00
| `tlsVerify`
| Enable secure HTTPS protocol when set to `true` (optional)
| `certPath`
| Path to certificate and key files for HTTPS (required if `tlsVerify` is `true`, ignored otherwise)
2022-03-12 05:27:22 +08:00
| `bindHostToBuilder`
| When `true`, the value of the `host` property will be provided to the container that is created for the CNB builder (optional)
2020-09-18 03:25:18 +08:00
|===
2021-05-20 12:16:06 +08:00
For more details, see also <<build-image.examples.docker,examples>>.
2020-09-18 03:25:18 +08:00
2020-01-31 09:02:47 +08:00
2020-04-01 13:51:16 +08:00
2021-05-20 12:16:06 +08:00
[[build-image.docker-registry]]
== Docker Registry
2020-09-19 06:59:10 +08:00
If the Docker images specified by the `builder` or `runImage` parameters are stored in a private Docker image registry that requires authentication, the authentication credentials can be provided using `docker.builderRegistry` parameters.
If the generated Docker image is to be published to a Docker image registry, the authentication credentials can be provided using `docker.publishRegistry` parameters.
2020-08-25 03:10:01 +08:00
Parameters are provided for user authentication or identity token authentication.
2020-09-19 06:59:10 +08:00
Consult the documentation for the Docker registry being used to store images for further information on supported authentication methods.
2020-08-25 03:10:01 +08:00
2020-09-19 06:59:10 +08:00
The following table summarizes the available parameters for `docker.builderRegistry` and `docker.publishRegistry`:
2020-08-25 03:10:01 +08:00
|===
| Parameter | Description
| `username`
| Username for the Docker image registry user. Required for user authentication.
| `password`
| Password for the Docker image registry user. Required for user authentication.
| `url`
| Address of the Docker image registry. Optional for user authentication.
| `email`
| E-mail address for the Docker image registry user. Optional for user authentication.
| `token`
| Identity token for the Docker image registry user. Required for token authentication.
|===
2021-05-20 12:16:06 +08:00
For more details, see also <<build-image.examples.docker,examples>>.
2020-08-25 03:10:01 +08:00
2021-05-20 12:16:06 +08:00
[[build-image.customization]]
== Image Customizations
2020-01-31 07:54:15 +08:00
The plugin invokes a {buildpacks-reference}/concepts/components/builder/[builder] to orchestrate the generation of an image.
The builder includes multiple {buildpacks-reference}/concepts/components/buildpack[buildpacks] that can inspect the application to influence the generated image.
By default, the plugin chooses a builder image.
The name of the generated image is deduced from project properties.
2020-06-12 05:20:39 +08:00
The `image` parameter allows configuration of the builder and how it should operate on the project.
2020-03-18 07:40:37 +08:00
The following table summarizes the available parameters and their default values:
2020-01-28 03:56:42 +08:00
2021-06-09 05:44:36 +08:00
[cols="1,4,1"]
2020-01-28 03:56:42 +08:00
|===
2021-06-09 05:44:36 +08:00
| Parameter / (User Property)| Description | Default value
2020-01-28 03:56:42 +08:00
2021-06-09 05:44:36 +08:00
| `builder` +
(`spring-boot.build-image.builder`)
2020-01-31 07:54:15 +08:00
| Name of the Builder image to use.
2020-10-10 03:36:46 +08:00
| `paketobuildpacks/builder:base`
2020-01-28 03:56:42 +08:00
2021-06-09 05:44:36 +08:00
| `runImage` +
(`spring-boot.build-image.runImage`)
2020-06-12 05:20:39 +08:00
| Name of the run image to use.
| No default value, indicating the run image specified in Builder metadata should be used.
2021-06-09 05:44:36 +08:00
| `name` +
(`spring-boot.build-image.imageName`)
2020-01-31 07:54:15 +08:00
| {spring-boot-api}/buildpack/platform/docker/type/ImageReference.html#of-java.lang.String-[Image name] for the generated image.
2021-06-09 05:44:36 +08:00
| `docker.io/library/` +
`${project.artifactId}:${project.version}`
2020-01-28 03:56:42 +08:00
2021-06-09 05:44:36 +08:00
| `pullPolicy` +
(`spring-boot.build-image.pullPolicy`)
2020-08-12 07:17:36 +08:00
| {spring-boot-api}/buildpack/platform/build/PullPolicy.html[Policy] used to determine when to pull the builder and run images from the registry.
Acceptable values are `ALWAYS`, `NEVER`, and `IF_NOT_PRESENT`.
| `ALWAYS`
2020-01-28 03:56:42 +08:00
| `env`
2020-01-31 07:54:15 +08:00
| Environment variables that should be passed to the builder.
2020-01-28 03:56:42 +08:00
|
2021-02-19 07:28:25 +08:00
| `buildpacks`
a|Buildpacks that the builder should use when building the image.
Only the specified buildpacks will be used, overriding the default buildpacks included in the builder.
Buildpack references must be in one of the following forms:
2021-02-23 03:10:54 +08:00
* Buildpack in the builder - `[urn:cnb:builder:]<buildpack ID>[@<version>]`
* Buildpack in a directory on the file system - `[file://]<path>`
* Buildpack in a gzipped tar (.tgz) file on the file system - `[file://]<path>/<file name>`
* Buildpack in an OCI image - `[docker://]<host>/<repo>[:<tag>][@<digest>]`
2021-02-19 07:28:25 +08:00
| None, indicating the builder should use the buildpacks included in it.
2021-02-23 03:10:54 +08:00
| `bindings`
a|https://docs.docker.com/storage/bind-mounts/[Volume bind mounts] that should be mounted to the builder container when building the image.
The bindings will be passed unparsed and unvalidated to Docker when creating the builder container.
Bindings must be in one of the following forms:
* `<host source path>:<container destination path>[:<options>]`
* `<host volume name>:<container destination path>[:<options>]`
Where `<options>` can contain:
* `ro` to mount the volume as read-only in the container
* `rw` to mount the volume as readable and writable in the container
* `volume-opt=key=value` to specify key-value pairs consisting of an option name and its value
|
2022-12-22 14:53:54 +08:00
| `network` + (`spring-boot.build-image.network`)
2021-08-13 06:07:49 +08:00
| The https://docs.docker.com/network/#network-drivers[network driver] the builder container will be configured to use.
The value supplied will be passed unvalidated to Docker when creating the builder container.
|
2022-12-22 14:53:54 +08:00
| `cleanCache` + (`spring-boot.build-image.cleanCache`)
2020-01-28 03:56:42 +08:00
| Whether to clean the cache before building.
| `false`
| `verboseLogging`
2020-01-31 07:54:15 +08:00
| Enables verbose logging of builder operations.
2020-01-28 03:56:42 +08:00
| `false`
2020-09-19 06:59:10 +08:00
2022-12-22 14:53:54 +08:00
| `publish` + (`spring-boot.build-image.publish`)
2020-09-19 06:59:10 +08:00
| Whether to publish the generated image to a Docker registry.
| `false`
2021-07-24 21:47:01 +08:00
2021-08-09 22:47:43 +08:00
| `tags`
2021-09-29 04:31:38 +08:00
| One or more additional tags to apply to the generated image.
2022-12-22 14:46:25 +08:00
The values provided to the `tags` option should be full image references in the form of `[image name]:[tag]` or `[repository]/[image name]:[tag]`.
2021-08-09 22:47:43 +08:00
|
2021-10-15 03:55:04 +08:00
| `caches`
2021-10-11 23:59:45 +08:00
| Cache volume names that should be used by the builder instead of generating random names.
|
2021-10-15 03:55:04 +08:00
| `buildCache`
| A cache containing layers created by buildpacks and used by the image building process.
| A named volume in the Docker daemon, with a name derived from the image name.
| `launchCache`
| A cache containing layers created by buildpacks and used by the image launching process.
| A named volume in the Docker daemon, with a name derived from the image name.
2020-01-28 03:56:42 +08:00
|===
2020-08-31 22:15:30 +08:00
NOTE: The plugin detects the target Java compatibility of the project using the compiler's plugin configuration or the `maven.compiler.target` property.
2020-10-09 06:02:17 +08:00
When using the default Paketo builder and buildpacks, the plugin instructs the buildpacks to install the same Java version.
2021-05-20 12:16:06 +08:00
You can override this behaviour as shown in the <<build-image.examples.builder-configuration,builder configuration>> examples.
2020-08-31 22:15:30 +08:00
2021-05-20 12:16:06 +08:00
For more details, see also <<build-image.examples,examples>>.
2020-01-23 23:35:45 +08:00
include::goals/build-image.adoc[leveloffset=+1]
2022-11-21 20:05:23 +08:00
include::goals/build-image-no-fork.adoc[leveloffset=+1]
2020-01-23 23:35:45 +08:00
2020-01-31 09:02:47 +08:00
2021-05-20 12:16:06 +08:00
[[build-image.examples]]
== Examples
2020-01-23 23:35:45 +08:00
2020-01-31 09:02:47 +08:00
2021-05-20 12:16:06 +08:00
[[build-image.examples.custom-image-builder]]
=== Custom Image Builder
2020-06-12 05:20:39 +08:00
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:
2020-01-23 23:35:45 +08:00
2021-03-06 10:24:35 +08:00
[source,xml,indent=0,subs="verbatim,attributes",tabsize=4]
2020-01-23 23:35:45 +08:00
----
2021-03-06 10:24:35 +08:00
include::../maven/packaging-oci-image/custom-image-builder-pom.xml[tags=custom-image-builder]
2020-01-23 23:35:45 +08:00
----
2020-06-12 05:20:39 +08:00
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`.
2020-01-23 23:35:45 +08:00
2020-06-12 05:20:39 +08:00
The builder and run image can be specified on the command line as well, as shown in this example:
2020-03-18 07:40:37 +08:00
[indent=0]
----
2020-06-12 05:20:39 +08:00
$ mvn spring-boot:build-image -Dspring-boot.build-image.builder=mine/java-cnb-builder -Dspring-boot.build-image.runImage=mine/java-cnb-run
2020-03-18 07:40:37 +08:00
----
2020-04-07 09:24:26 +08:00
2021-05-20 12:16:06 +08:00
[[build-image.examples.builder-configuration]]
=== Builder Configuration
2020-04-07 07:20:34 +08:00
If the builder exposes configuration options using environment variables, those can be set using the `env` attributes.
2020-10-09 06:02:17 +08:00
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:
2020-01-28 03:56:42 +08:00
2021-03-06 10:24:35 +08:00
[source,xml,indent=0,subs="verbatim,attributes",tabsize=4]
2020-01-28 03:56:42 +08:00
----
2021-03-06 10:24:35 +08:00
include::../maven/packaging-oci-image/build-image-example-builder-configuration-pom.xml[tags=build-image-example-builder-configuration]
2020-01-28 03:56:42 +08:00
----
2020-04-07 07:20:34 +08:00
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.
2020-10-09 06:02:17 +08:00
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:
2020-04-07 07:20:34 +08:00
2021-03-06 10:24:35 +08:00
[source,xml,indent=0,subs="verbatim,attributes",tabsize=4]
2020-04-07 07:20:34 +08:00
----
2021-03-06 10:24:35 +08:00
include::../maven/packaging-oci-image/paketo-pom.xml[tags=paketo]
2020-04-07 07:20:34 +08:00
----
2020-01-28 03:56:42 +08:00
2020-01-23 23:35:45 +08:00
2021-05-20 12:16:06 +08:00
[[build-image.examples.runtime-jvm-configuration]]
=== Runtime JVM Configuration
2021-04-10 02:46:41 +08:00
Paketo Java buildpacks {paketo-java-reference}/#runtime-jvm-configuration[configure the JVM runtime environment] by setting the `JAVA_TOOL_OPTIONS` environment variable.
The buildpack-provided `JAVA_TOOL_OPTIONS` value can be modified to customize JVM runtime behavior when the application image is launched in a container.
Environment variable modifications that should be stored in the image and applied to every deployment can be set as described in the {paketo-reference}/buildpacks/configuration/#environment-variables[Paketo documentation] and shown in the following example:
2021-04-10 03:22:51 +08:00
[source,xml,indent=0,subs="verbatim,attributes",tabsize=4]
2021-04-10 02:46:41 +08:00
----
2021-04-10 03:22:51 +08:00
include::../maven/packaging-oci-image/runtime-jvm-configuration-pom.xml[tags=runtime-jvm-configuration]
2021-04-10 02:46:41 +08:00
----
2021-05-20 12:16:06 +08:00
[[build-image.examples.custom-image-name]]
=== Custom Image Name
2020-01-31 07:54:15 +08:00
By default, the image name is inferred from the `artifactId` and the `version` of the project, something like `docker.io/library/${project.artifactId}:${project.version}`.
2020-01-23 23:35:45 +08:00
You can take control over the name, as shown in the following example:
2021-03-06 10:24:35 +08:00
[source,xml,indent=0,subs="verbatim,attributes",tabsize=4]
2020-01-23 23:35:45 +08:00
----
2021-03-06 10:24:35 +08:00
include::../maven/packaging-oci-image/custom-image-name-pom.xml[tags=custom-image-name]
2020-01-23 23:35:45 +08:00
----
2020-10-16 16:34:58 +08:00
NOTE: This configuration does not provide an explicit tag so `latest` is used.
2020-03-18 07:40:37 +08:00
It is possible to specify a tag as well, either using `${project.version}`, any property available in the build or a hardcoded version.
The image name can be specified on the command line as well, as shown in this example:
[indent=0]
----
2020-05-21 05:06:48 +08:00
$ mvn spring-boot:build-image -Dspring-boot.build-image.imageName=example.com/library/my-app:v1
2020-03-18 07:40:37 +08:00
----
2020-08-25 03:10:01 +08:00
2021-05-20 12:16:06 +08:00
[[build-image.examples.buildpacks]]
=== Buildpacks
2021-02-19 07:28:25 +08:00
By default, the builder will use buildpacks included in the builder image and apply them in a pre-defined order.
An alternative set of buildpacks can be provided to apply buildpacks that are not included in the builder, or to change the order of included buildpacks.
When one or more buildpacks are provided, only the specified buildpacks will be applied.
The following example instructs the builder to use a custom buildpack packaged in a `.tgz` file, followed by a buildpack included in the builder.
2021-03-06 10:24:35 +08:00
[source,xml,indent=0,subs="verbatim,attributes",tabsize=4]
2021-02-19 07:28:25 +08:00
----
2021-03-06 10:24:35 +08:00
include::../maven/packaging-oci-image/buildpacks-pom.xml[tags=buildpacks]
2021-02-19 07:28:25 +08:00
----
Buildpacks can be specified in any of the forms shown below.
A buildpack located in a CNB Builder (version may be omitted if there is only one buildpack in the builder matching the `buildpack-id`):
* `urn:cnb:builder:buildpack-id`
* `urn:cnb:builder:buildpack-id@0.0.1`
* `buildpack-id`
* `buildpack-id@0.0.1`
A path to a directory containing buildpack content (not supported on Windows):
* `\file:///path/to/buildpack/`
* `/path/to/buildpack/`
A path to a gzipped tar file containing buildpack content:
* `\file:///path/to/buildpack.tgz`
* `/path/to/buildpack.tgz`
2021-02-19 08:22:36 +08:00
An OCI image containing a https://buildpacks.io/docs/buildpack-author-guide/package-a-buildpack/[packaged buildpack]:
2021-02-19 07:28:25 +08:00
* `docker://example/buildpack`
* `docker:///example/buildpack:latest`
* `docker:///example/buildpack@sha256:45b23dee08...`
* `example/buildpack`
* `example/buildpack:latest`
* `example/buildpack@sha256:45b23dee08...`
2021-05-20 12:16:06 +08:00
[[build-image.examples.publish]]
=== Image Publishing
2022-07-20 04:25:22 +08:00
The generated image can be published to a Docker registry by enabling a `publish` option.
If the Docker registry requires authentication, the credentials can be configured using `docker.publishRegistry` parameters.
If the Docker registry does not require authentication, the `docker.publishRegistry` configuration can be omitted.
2020-09-19 06:59:10 +08:00
2022-07-21 06:29:40 +08:00
NOTE: The registry that the image will be published to is determined by the registry part of the image name (`docker.example.com` in these examples).
If `docker.publishRegistry` credentials are configured and include a `url` parameter, this value is passed to the registry but is not used to determine the publishing registry location.
2021-03-06 10:24:35 +08:00
[source,xml,indent=0,subs="verbatim,attributes",tabsize=4]
2020-09-19 06:59:10 +08:00
----
2021-03-06 10:24:35 +08:00
include::../maven/packaging-oci-image/docker-pom.xml[tags=docker]
2020-09-19 06:59:10 +08:00
----
The `publish` option can be specified on the command line as well, as shown in this example:
[indent=0]
----
$ mvn spring-boot:build-image -Dspring-boot.build-image.imageName=docker.example.com/library/my-app:v1 -Dspring-boot.build-image.publish=true
----
2023-03-10 04:21:08 +08:00
When using the `publish` option on the command line with authentication, you can provide credentials using properties as in this example:
2023-03-09 02:00:44 +08:00
[indent=0]
----
$ mvn spring-boot:build-image \
-Ddocker.publishRegistry.username=user \
-Ddocker.publishRegistry.password=secret \
-Ddocker.publishRegistry.url=docker.example.com \
-Dspring-boot.build-image.publish=true \
2023-03-10 04:21:08 +08:00
-Dspring-boot.build-image.imageName=docker.example.com/library/my-app:v1
2023-03-09 02:00:44 +08:00
----
2023-03-10 04:21:08 +08:00
and reference the properties in the XML configuration:
2023-03-09 02:00:44 +08:00
[source,xml,indent=0,subs="verbatim,attributes",tabsize=4]
----
include::../maven/packaging-oci-image/docker-pom-authentication-command-line.xml[tags=docker]
----
2021-10-15 03:55:04 +08:00
[[build-image.examples.caches]]
=== Builder Cache Configuration
The CNB builder caches layers that are used when building and launching an image.
By default, these caches are stored as named volumes in the Docker daemon with names that are derived from the full name of the target image.
If the image name changes frequently, for example when the project version is used as a tag in the image name, then the caches can be invalidated frequently.
The cache volumes can be configured to use alternative names to give more control over cache lifecycle as shown in the following example:
2020-09-19 06:59:10 +08:00
2021-10-15 03:55:04 +08:00
[source,xml,indent=0,subs="verbatim,attributes",tabsize=4]
----
include::../maven/packaging-oci-image/caches-pom.xml[tags=caches]
----
2020-09-19 06:59:10 +08:00
2021-05-20 12:16:06 +08:00
[[build-image.examples.docker]]
=== Docker Configuration
2021-10-15 03:55:04 +08:00
2022-03-12 06:39:07 +08:00
[[build-image.examples.docker.minikube]]
==== Docker Configuration for minikube
The plugin can communicate with the https://minikube.sigs.k8s.io/docs/tasks/docker_daemon/[Docker daemon provided by minikube] instead of the default local connection.
On Linux and macOS, environment variables can be set using the command `eval $(minikube docker-env)` after minikube has been started.
The plugin can also be configured to use the minikube daemon by providing connection details similar to those shown in the following example:
[source,xml,indent=0,subs="verbatim,attributes",tabsize=4]
----
include::../maven/packaging-oci-image/docker-minikube-pom.xml[tags=docker-minikube]
----
[[build-image.examples.docker.podman]]
==== Docker Configuration for podman
The plugin can communicate with a https://podman.io/[podman container engine].
The plugin can be configured to use podman local connection by providing connection details similar to those shown in the following example:
2020-09-18 03:25:18 +08:00
2021-03-06 10:24:35 +08:00
[source,xml,indent=0,subs="verbatim,attributes",tabsize=4]
2020-09-18 03:25:18 +08:00
----
2022-03-12 06:39:07 +08:00
include::../maven/packaging-oci-image/docker-podman-pom.xml[tags=docker-podman]
2020-09-18 03:25:18 +08:00
----
2023-03-04 06:47:48 +08:00
TIP: With the `podman` CLI installed, the command `podman info --format='{{.Host.RemoteSocket.Path}}'` can be used to get the value for the `docker.host` configuration property shown in this example.
2022-03-12 06:39:07 +08:00
[[build-image.examples.docker.auth]]
==== Docker Configuration for Authentication
2020-09-19 06:59:10 +08:00
If the builder or run image are stored in a private Docker registry that supports user authentication, authentication details can be provided using `docker.builderRegistry` parameters as shown in the following example:
2020-08-25 03:10:01 +08:00
2021-03-06 10:24:35 +08:00
[source,xml,indent=0,subs="verbatim,attributes",tabsize=4]
2020-08-25 03:10:01 +08:00
----
2021-03-06 10:24:35 +08:00
include::../maven/packaging-oci-image/docker-registry-authentication-pom.xml[tags=docker-registry-authentication]
2020-08-25 03:10:01 +08:00
----
2020-09-19 06:59:10 +08:00
If the builder or run image is stored in a private Docker registry that supports token authentication, the token value can be provided using `docker.builderRegistry` parameters as shown in the following example:
2020-08-25 03:10:01 +08:00
2021-03-06 10:24:35 +08:00
[source,xml,indent=0,subs="verbatim,attributes",tabsize=4]
2020-08-25 03:10:01 +08:00
----
2021-03-06 10:24:35 +08:00
include::../maven/packaging-oci-image/docker-token-authentication-pom.xml[tags=docker-token-authentication]
2020-08-25 03:10:01 +08:00
----