Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I temporarily disable the wincred provider for docker login?

Tags:

docker

windows

I NEED the creds in plain text but docker login seems to store them in the windows cred provider by default now. I know it was changed to make it more secure, but more my purpose I need a plain text config file.

This is really frustrating because there seems to be no documentation explaining how to change the cred provider or change back to plain text.

The docker config file it generates doesnt' have any keys it just has this:

{
    "auths": {
        "gcr.io": {}
    },
    "HttpHeaders": {
        "User-Agent": "Docker-Client/17.09.0-ce (windows)"
    },
    "credsStore": "wincred"
}

How do I temporarily disable this so I can get a config I can use?

like image 460
red888 Avatar asked Jan 30 '23 07:01

red888


2 Answers

This is stupid but I "solved" this problem by renaming the provider itself so docker login couldn't find it:

"C:\Program Files\Docker\Docker\Resources\bin\docker-credential-wincred.exe"

If you rename the exe and run login it fails, then if you run it again it succeeds and outputs the key in plain text in the config.json.

There has to be a simple way of selecting which provider you want to use or falling back to plain text without doing this, but the docs... suck.

I'll mark this as an answer if no one posts the correct way of doing this.

like image 134
red888 Avatar answered Jan 31 '23 21:01

red888


If you have WSL enabled you can use wsl docker --config . login to store plain text config.json in current directory.

like image 34
verglor Avatar answered Jan 31 '23 21:01

verglor