Add network option for image building

This commit adds configuration to the Maven and Gradle plugins to
allow specifying the network mode to be provided to the image
building goal and task.

See gh-27486
This commit is contained in:
Jeroen Meijer
2021-07-24 15:47:01 +02:00
committed by Scott Frederick
parent e737388f5c
commit 8e6d03b221
17 changed files with 195 additions and 15 deletions

View File

@@ -176,6 +176,14 @@ Where `<options>` can contain:
(`spring-boot.build-image.publish`)
| Whether to publish the generated image to a Docker registry.
| `false`
| `network` +
(`spring-boot.build-image.network`)
| The network the build container will connect to. The value supplied for this option will be passed
unvalidated as `HostConfig.NetworkMode` to the configuration which creates the build container,
see https://docs.docker.com/engine/api/v1.41/#operation/ContainerCreate[Docker's engine API].
Using this option is similar to running `docker build --network ...`.
|
|===
NOTE: The plugin detects the target Java compatibility of the project using the compiler's plugin configuration or the `maven.compiler.target` property.