Sharing docker credentials between Window and WSL Sharing docker credentials between Window and WSL docker docker

Sharing docker credentials between Window and WSL


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


Update Feb 2021

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:

  • In General: us the WSL 2 based engine
  • In Resource/WSL Integration: enable integration with your default WSL distro

You will have to restart docker. Once it is done, everything works transparently.

Below here can be ignored

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.