Skip to content
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

Credentials helper not working with new docker versions #1068

Closed
furti opened this issue Aug 24, 2018 · 7 comments
Closed

Credentials helper not working with new docker versions #1068

furti opened this issue Aug 24, 2018 · 7 comments

Comments

@furti
Copy link

furti commented Aug 24, 2018

Description

With the newest docker version the credentials helper seems to fail to get the credentials even when logged in to docker with docker login before.

Info

Running mvn docker:push -Ddocker.tag=$USERNAME -Ddocker.verbose=true -X on the console gives me this output:

...
[INFO] DOCKER> Credentials helper reply for "docker-credential-wincred" is 0.6.0
[DEBUG] DOCKER> AuthConfig: credentials from credential helper/store docker-credential-wincred version 0.6.0
[DEBUG] DOCKER> AuthConfig: no credentials found
...
Caused by: io.fabric8.maven.docker.access.DockerAccessException: no basic auth credentials

I think the problem is the following:
In io.fabric8.maven.docker.util.CredentialHelperClient.getAuthConfig(..) Line 41 you prefix the registry with "https://" by default. Maybe the older versions needed this. But the new docker version does not need the prefix anymore.

With prefix

$ echo https://my.registry.com | docker-credential-wincred get
credentials not found in native keychain

Without prefix

$ echo my.registry.com | docker-credential-wincred get
{"ServerURL":"my.registry.com","Username":"user","Secret":"password"}
  • d-m-p version : 0.26.1
  • Maven version (mvn -v) :
Apache Maven 3.2.1 (ea8b2b07643dbb1b84b6d16e1f08391b666bc1e9; 2014-02-14T18:37:52+01:00)
Java version: 1.8.0_121, vendor: Oracle Corporation
Default locale: de_AT, platform encoding: Cp1252
OS name: "windows 10", version: "10.0", arch: "amd64", family: "dos"
  • Docker version : Docker version 18.06.0-ce, build 0ffa825
@thedikiy
Copy link

To workaround this, I had to use store command specifying https://docker.mypath.net explicitly.
The thing is that even if you are using docker login command with "https://" in server url, the entry will be saved without protocol.
Ubuntu 16.04 docker-credential-pass

@rhuss
Copy link
Collaborator

rhuss commented Sep 28, 2018

@furti thanks for reporting, and sorry for the delay.

I think we should try both, with prefix and without. I'm a bit busy these days, so if you would like to tackle this and submit a PR, that would be awesome. Otherwise I'm going to tackle this next weeks.

@jakub-bochenski
Copy link
Contributor

I think we hit this problem too.

[DEBUG] DOCKER> AuthConfig: credentials from credential helper/store docker-credential-wincred version 0.6.0
[DEBUG] DOCKER> AuthConfig: no credentials found

A workaround we used was to disable the credentials helper and just store the auth data in config.json

rhuss added a commit to rhuss/docker-maven-plugin that referenced this issue Sep 28, 2018
rhuss added a commit that referenced this issue Sep 28, 2018
fix: Allow credentialhelper look up the registry without scheme prefix (#1068)
@rhuss
Copy link
Collaborator

rhuss commented Sep 28, 2018

Can you please check version 0.27.1 where I added a fix for this ?

@jakub-bochenski
Copy link
Contributor

Thanks, it worked with 0.27.1

@rhuss
Copy link
Collaborator

rhuss commented Oct 1, 2018

Cool, thanks for the feedback!

@furti
Copy link
Author

furti commented Jan 17, 2019

Sorry for the late reply. Unfortunately had no time to test this until now. :/

Tested it right now and it also works for me now :)

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

No branches or pull requests

4 participants