Merge pull request #34517 from anthonydahanne

* gh-34517:
  Polish "Add documentation for publishing images with Maven command line"
  Add documentation for publishing images with Maven command line

Closes gh-34517
pull/34764/head
Scott Frederick 2 years ago
commit bf48c6c7f3

@ -357,6 +357,25 @@ The `publish` option can be specified on the command line as well, as shown in t
$ mvn spring-boot:build-image -Dspring-boot.build-image.imageName=docker.example.com/library/my-app:v1 -Dspring-boot.build-image.publish=true
----
When using the `publish` option on the command line with authentication, you can provide credentials using properties as in this example:
[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 \
-Dspring-boot.build-image.imageName=docker.example.com/library/my-app:v1
----
and reference the properties in the XML configuration:
[source,xml,indent=0,subs="verbatim,attributes",tabsize=4]
----
include::../maven/packaging-oci-image/docker-pom-authentication-command-line.xml[tags=docker]
----
[[build-image.examples.caches]]
=== Builder Cache Configuration

@ -0,0 +1,22 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- tag::docker[] -->
<project>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<docker>
<publishRegistry>
<url>${docker.publishRegistry.url}</url>
<username>${docker.publishRegistry.username}</username>
<password>${docker.publishRegistry.password}</password>
</publishRegistry>
</docker>
</configuration>
</plugin>
</plugins>
</build>
</project>
<!-- end::docker[] -->
Loading…
Cancel
Save