Reputation: 159
Running commands such as docker build
, docker ps
, docker pull
, docker images
all work fine. Now I would like push an image and so of course I have to login first.
docker login
in the WSL terminal Error saving credentials: error storing credentials - err: exec: "docker-credential-desktop": executable file not found in %PATH
%, out: ``
docker login
from powershell works fine. So I created a symbolic link between /mnt/c/Users/<winusername>/.docker
and /home/<wslusername>/.docker
. The equivalent works fine for .aws
, but for .docker
it was not able to share or even acknowledge the credentials, so it asked again for the user and password and threw the same error as above.
Upvotes: 3
Views: 13959
Reputation: 159
This is all much simpler now. If you are using WSL2 on a recent release of Windows, just install docker on the Windows side and ensure to configurations:
You will have to restart docker. Once it is done, everything works transparently.
It turns out that the integration between Docker and WSL is better than I thought. Though it could have been better documented. I was going to change tack and try to install docker in the WSL. So I got rid of all the aliases and restarted my session. Lo and behold, when I ran docker
there was still something running.
This is because the edge version of docker create the appropriate symbolic links and now I login into docker hub without any problem.
Upvotes: 2
Reputation: 51
This worked for me,
sudo ln -s /mnt/c/Program\ Files/Docker/Docker/resources/bin/docker-credential-desktop.exe /usr/bin/docker-credential-desktop.exe
Linking the executable from windows path to linux path or you can add the windows PATH on you linux PATH.
Refer: https://github.com/docker/for-win/issues/6652
Upvotes: 5