From 4e0b3aad9f8e5aee286c08cb7412818a409ec988 Mon Sep 17 00:00:00 2001 From: Scott Frederick Date: Wed, 20 Jul 2022 17:29:40 -0500 Subject: [PATCH] Clarify how docker image publishing registry is determined Closes gh-31820 --- .../src/docs/asciidoc/packaging-oci-image.adoc | 3 +++ .../src/docs/gradle/packaging/boot-build-image-publish.gradle | 2 -- .../docs/gradle/packaging/boot-build-image-publish.gradle.kts | 2 -- .../src/docs/asciidoc/packaging-oci-image.adoc | 3 +++ .../src/docs/maven/packaging-oci-image/docker-pom.xml | 2 -- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/asciidoc/packaging-oci-image.adoc b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/asciidoc/packaging-oci-image.adoc index 661b0d412cb4..5d3399825846 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/asciidoc/packaging-oci-image.adoc +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/asciidoc/packaging-oci-image.adoc @@ -373,6 +373,9 @@ The generated image can be published to a Docker registry by enabling a `publish If the Docker registry requires authentication, the credentials can be configured using `docker.publishRegistry` properties. If the Docker registry does not require authentication, the `docker.publishRegistry` configuration can be omitted. +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` property, this value is passed to the registry but is not used to determine the publishing registry location. + [source,groovy,indent=0,subs="verbatim,attributes",role="primary"] .Groovy ---- diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/boot-build-image-publish.gradle b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/boot-build-image-publish.gradle index f3603a4405f9..aaaab48cf4f2 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/boot-build-image-publish.gradle +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/boot-build-image-publish.gradle @@ -15,8 +15,6 @@ tasks.named("bootBuildImage") { publishRegistry { username = "user" password = "secret" - url = "https://docker.example.com/v1/" - email = "user@example.com" } } } diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/boot-build-image-publish.gradle.kts b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/boot-build-image-publish.gradle.kts index 6c6d11423019..01bdc5b5204d 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/boot-build-image-publish.gradle.kts +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/boot-build-image-publish.gradle.kts @@ -18,8 +18,6 @@ tasks.named("bootBuildImage") { publishRegistry { username = "user" password = "secret" - url = "https://docker.example.com/v1/" - email = "user@example.com" } } } diff --git a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/docs/asciidoc/packaging-oci-image.adoc b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/docs/asciidoc/packaging-oci-image.adoc index ae5ebded1a94..6af43f3b2cac 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/docs/asciidoc/packaging-oci-image.adoc +++ b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/docs/asciidoc/packaging-oci-image.adoc @@ -343,6 +343,9 @@ The generated image can be published to a Docker registry by enabling a `publish 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. +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. + [source,xml,indent=0,subs="verbatim,attributes",tabsize=4] ---- include::../maven/packaging-oci-image/docker-pom.xml[tags=docker] diff --git a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/docs/maven/packaging-oci-image/docker-pom.xml b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/docs/maven/packaging-oci-image/docker-pom.xml index 377b0c717274..970a19d2e490 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/docs/maven/packaging-oci-image/docker-pom.xml +++ b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/docs/maven/packaging-oci-image/docker-pom.xml @@ -15,8 +15,6 @@ user secret - https://docker.example.com/v1/ - user@example.com