spring-boot icon indicating copy to clipboard operation
spring-boot copied to clipboard

Update DockerApi to support configured authentication

Open philwebb opened this issue 4 years ago • 3 comments

We're currently hitting rate limit issues with our tests due to the fact that the Docker config.json files is not read. We should ideally add support to our DockerApi class.

Some references to consider when implementing:

https://github.com/testcontainers/testcontainers-java/blob/bc48eebeefb344b0878637c021b8a1998ff4d677/core/src/main/java/org/testcontainers/utility/RegistryAuthLocator.java

https://github.com/docker-java/docker-java/blob/0306031832432454fbbdbf5c20e16fe881c7b065/docker-java-core/src/main/java/com/github/dockerjava/core/DockerConfigFile.java#L50

philwebb avatar Apr 07 '21 05:04 philwebb

See also #25838

philwebb avatar Apr 07 '21 05:04 philwebb

I guess we can close #25889 in that case given that you have a more concrete suggestion here.

dreis2211 avatar Apr 07 '21 07:04 dreis2211

When implementing this, we'll have to consider how authentication in a config.json file works with authentication provided in the Maven or Gradle build configuration - for example, which one takes precedence.

config.json allows authentication to be configured for each Docker registry, based on the registry in the image reference. This could be the way to implement #24547 also.

scottfrederick avatar Apr 07 '21 16:04 scottfrederick