New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docker credential helpers not supported on Windows #756

Closed
rnorth opened this Issue Jun 15, 2018 · 4 comments

Comments

Projects
None yet
2 participants
@rnorth
Member

rnorth commented Jun 15, 2018

We've not yet had a chance to test RegistryAuthLocator on Windows, so it is unsupported.

If we can test it/fix it, it will enable us to properly support this feature.

@kiview

This comment has been minimized.

Member

kiview commented Jun 22, 2018

I'll try to check this on Windows this weekend 👍

@kiview

This comment has been minimized.

Member

kiview commented Jul 1, 2018

Here are my results so far. I was logged into docker hub.
For docker hub:

22:51:20.108 INFO  docker[alpine:latest] - Pulling docker image: alpine:latest. Please be patient; this may take some time but only needs to be done once.
22:51:20.109 DEBUG org.testcontainers.utility.RegistryAuthLocator - Looking up auth config for image: alpine:latest
22:51:20.110 DEBUG org.testcontainers.utility.RegistryAuthLocator - RegistryAuthLocator has configFile: C:\Users\Kivie\.docker\config.json (exists) and commandPathPrefix: 
22:51:20.112 DEBUG org.testcontainers.utility.RegistryAuthLocator - Executing docker credential helper: docker-credential-wincred to locate auth config for: 
22:51:20.175 ERROR org.testcontainers.utility.RegistryAuthLocator - Failure running docker credential helper (docker-credential-wincred)
22:51:20.177 ERROR org.testcontainers.utility.RegistryAuthLocator - Failure when attempting to lookup auth config (dockerImageName: alpine:latest, configFile: C:\Users\Kivie\.docker\config.json. Falling back to docker-java default behaviour
org.zeroturnaround.exec.InvalidExitValueException: Unexpected exit value: 1, allowed exit values: [0], executed command [docker-credential-wincred, get], output was 26 bytes:
no credentials server URL

For quay.io:

22:51:54.548 INFO  docker[quay.io/testcontainers/ryuk:latest] - Pulling docker image: quay.io/testcontainers/ryuk:latest. Please be patient; this may take some time but only needs to be done once.
22:51:54.549 DEBUG org.testcontainers.utility.RegistryAuthLocator - Looking up auth config for image: quay.io/testcontainers/ryuk:latest
22:51:54.549 DEBUG org.testcontainers.utility.RegistryAuthLocator - RegistryAuthLocator has configFile: C:\Users\Kivie\.docker\config.json (exists) and commandPathPrefix: 
22:51:54.549 DEBUG org.testcontainers.utility.RegistryAuthLocator - Executing docker credential helper: docker-credential-wincred to locate auth config for: quay.io
22:51:54.604 ERROR org.testcontainers.utility.RegistryAuthLocator - Failure running docker credential helper (docker-credential-wincred)
22:51:54.605 ERROR org.testcontainers.utility.RegistryAuthLocator - Failure when attempting to lookup auth config (dockerImageName: quay.io/testcontainers/ryuk:latest, configFile: C:\Users\Kivie\.docker\config.json. Falling back to docker-java default behaviour
org.zeroturnaround.exec.InvalidExitValueException: Unexpected exit value: 1, allowed exit values: [0], executed command [docker-credential-wincred, get], output was 41 bytes:
credentials not found in native keychain
	at org.zeroturnaround.exec.ProcessExecutor.waitFor(ProcessExecutor.java:1118)
	at org.zeroturnaround.exec.ProcessExecutor.execute(ProcessExecutor.java:925)
	at org.testcontainers.utility.RegistryAuthLocator.runCredentialProvider(RegistryAuthLocator.java:162)
	at org.testcontainers.utility.RegistryAuthLocator.authConfigUsingStore(RegistryAuthLocator.java:129)
	at org.testcontainers.utility.RegistryAuthLocator.lookupAuthConfig(RegistryAuthLocator.java:88)
	at org.testcontainers.images.RemoteDockerImage.resolve(RemoteDockerImage.java:99)
	at org.testcontainers.images.RemoteDockerImage.resolve(RemoteDockerImage.java:27)
...

TBH, I not even getting docker-credential-wincred working by hand. list command works fine, get command doesn't return any output for me, maybe I'm doing something wrong?

aulea pushed a commit to aulea/testcontainers-java that referenced this issue Sep 14, 2018

@aulea aulea referenced this issue Sep 14, 2018

Merged

Feature/756 #868

aulea pushed a commit to aulea/testcontainers-java that referenced this issue Sep 14, 2018

aulea pushed a commit to aulea/testcontainers-java that referenced this issue Sep 18, 2018

aulea pushed a commit to aulea/testcontainers-java that referenced this issue Sep 18, 2018

Alar Aule
testcontainers#756 RegistryAuthLocator with discovering exact 'creden…
…tials not found' error message for each credentials helper

aulea pushed a commit to aulea/testcontainers-java that referenced this issue Sep 18, 2018

Alar Aule
testcontainers#756 RegistryAuthLocator with discovering exact 'creden…
…tials not found' error message for each credentials helper. unix fake credential helper fix

aulea pushed a commit to aulea/testcontainers-java that referenced this issue Sep 20, 2018

rnorth added a commit that referenced this issue Sep 20, 2018

Improved RegistryAuthLocator and added tests for Windows (#868)
#756 tested on Windows. 
Fixed RegistryAuthLocatorTest on Windows and also allowed better fallbacks from running credential provider (to allow lookup alternative AuthConfigs), when:
1) there is no hostName, then there is no point to ask credentials
2) when credential helper response with "credentials not found in native keychain" to try other resources

Main reason for failing for me on Windows machine was #710 changes. When i used Netty or OkHttp together with npipe, then it worked fine. Yesterday evening i found out the reason and today morning i found also fix in master for that :-) - #865, breaking docker response by line breaks.
@stale

This comment has been minimized.

stale bot commented Oct 28, 2018

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. If you believe this is a mistake, please reply to this comment to keep it open. If there isn't one already, a PR to fix or at least reproduce the problem in a test case will always help us get back on track to tackle this.

@stale stale bot added the stale label Oct 28, 2018

@rnorth

This comment has been minimized.

Member

rnorth commented Oct 28, 2018

Ah, we released support for this in 1.9.1 (#868) so I shall close.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment