spring-projects / spring-boot

Spring Boot
https://spring.io/projects/spring-boot
Apache License 2.0
74.5k stars 40.53k forks source link

Update DockerApi to support configured authentication #25898

Open philwebb opened 3 years ago

philwebb commented 3 years ago

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 commented 3 years ago

See also #25838

dreis2211 commented 3 years ago

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

scottfrederick commented 3 years ago

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.