Why doesn't the Docker client use Windows' credentials helper? · docker-java/docker-java · Discussion #2358
Hello,
If I'm using Docker Desktop on Windows with a credentialsHelper configured in my %APPDATA%/Docker/settings.json, e.g.:
{
...
"credentialHelper": "docker-credential-ecr-login.exe",
...
}I can pull an image as follows:
docker image pull my.registry.com/my/repository:tag
And Docker will use the configured credentials helper to get the right credentials (e.g. from ~/.aws for the ECR helper above).
But if I use the docker-java, e.g.
try (var cmd = dockerClient.pullImageCmd(imageName)) { return cmd.start(); }
it fails as it doesn't have any credentials.
I noticed testcontainers does it manually by executing the credentials provider, but that's a lot of work, doesn't support the settings.json in Docker Desktop, and I'd have expected it to work out of the box.
Is there a way of configuring the Docker client to do this itself, and if not, why not? I would have expected this to be done by the Docker daemon in the background.