Skip to content

Commit 6a6f4a3

Browse files
Merge branch '2.7.x' into 3.0.x
Closes gh-34704
2 parents bd27a8a + bf48c6c commit 6a6f4a3

File tree

2 files changed

+41
-0
lines changed

2 files changed

+41
-0
lines changed

spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/docs/asciidoc/packaging-oci-image.adoc

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -363,6 +363,25 @@ The `publish` option can be specified on the command line as well, as shown in t
363363
$ mvn spring-boot:build-image -Dspring-boot.build-image.imageName=docker.example.com/library/my-app:v1 -Dspring-boot.build-image.publish=true
364364
----
365365

366+
When using the `publish` option on the command line with authentication, you can provide credentials using properties as in this example:
367+
368+
[indent=0]
369+
----
370+
$ mvn spring-boot:build-image \
371+
-Ddocker.publishRegistry.username=user \
372+
-Ddocker.publishRegistry.password=secret \
373+
-Ddocker.publishRegistry.url=docker.example.com \
374+
-Dspring-boot.build-image.publish=true \
375+
-Dspring-boot.build-image.imageName=docker.example.com/library/my-app:v1
376+
----
377+
378+
and reference the properties in the XML configuration:
379+
380+
[source,xml,indent=0,subs="verbatim,attributes",tabsize=4]
381+
----
382+
include::../maven/packaging-oci-image/docker-pom-authentication-command-line.xml[tags=docker]
383+
----
384+
366385
[[build-image.examples.caches]]
367386
=== Builder Cache Configuration
368387

Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!-- tag::docker[] -->
3+
<project>
4+
<build>
5+
<plugins>
6+
<plugin>
7+
<groupId>org.springframework.boot</groupId>
8+
<artifactId>spring-boot-maven-plugin</artifactId>
9+
<configuration>
10+
<docker>
11+
<publishRegistry>
12+
<url>${docker.publishRegistry.url}</url>
13+
<username>${docker.publishRegistry.username}</username>
14+
<password>${docker.publishRegistry.password}</password>
15+
</publishRegistry>
16+
</docker>
17+
</configuration>
18+
</plugin>
19+
</plugins>
20+
</build>
21+
</project>
22+
<!-- end::docker[] -->

0 commit comments

Comments
 (0)