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

Comment From: philwebb

See also #25838

Comment From: dreis2211

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

Comment From: scottfrederick

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.