Skip to content

Commit

Permalink
Merge pull request #34517 from anthonydahanne
Browse files Browse the repository at this point in the history
* gh-34517:
  Polish "Add documentation for publishing images with Maven command line"
  Add documentation for publishing images with Maven command line

Closes gh-34517
  • Loading branch information
scottfrederick committed Mar 21, 2023
2 parents 932c203 + ad680ed commit bf48c6c
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
Original file line number Diff line number Diff line change
@@ -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[] -->

0 comments on commit bf48c6c

Please sign in to comment.