Skip to content

Commit 03a87cc

Browse files
committed
Clarify how Container's Docker image name is used to name a connection
Closes gh-41111
1 parent 270597e commit 03a87cc

File tree

1 file changed

+2
-1
lines changed
  • spring-boot-project/spring-boot-docs/src/docs/asciidoc/features

1 file changed

+2
-1
lines changed

spring-boot-project/spring-boot-docs/src/docs/asciidoc/features/testing.adoc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1040,7 +1040,8 @@ For example, a `PostgreSQLContainer` will create both `JdbcConnectionDetails` an
10401040
If you want to create only a subset of the applicable types, you can use the `type` attribute of `@ServiceConnection`.
10411041
====
10421042

1043-
By default `Container.getDockerImageName()` is used to obtain the name used to find connection details.
1043+
By default `Container.getDockerImageName().getRepository()` is used to obtain the name used to find connection details.
1044+
The repository portion of the Docker image name ignores any registry and the version.
10441045
This works as long as Spring Boot is able to get the instance of the `Container`, which is the case when using a `static` field like in the example above.
10451046

10461047
If you're using a `@Bean` method, Spring Boot won't call the bean method to get the Docker image name, because this would cause eager initialization issues.

0 commit comments

Comments
 (0)