Why does “login to Docker” fail in the Docker quick launch terminal, but it works from the machine by default?

I installed the Docker Toolbox on Windows 8.1 and follow the installation instructions. When you come to the step where you create and click on your own image , I got this error when I tried to launch docker login ...

 ### VIA Docker Quickstart Terminal ### docker login --username=myuser --password="mypass" --email=myemail@gmail.com time="2015-11-17T03:20:58.160803558Z" level=debug msg="Calling POST /v1.21/auth" time="2015-11-17T03:20:58.160838971Z" level=info msg="POST /v1.21/auth" time="2015-11-17T03:20:58.169033324Z" level=debug msg="hostDir: /etc/docker/certs.d/https:/registry-win-tp3.docker.io/v1" time="2015-11-17T03:20:58.169071565Z" level=debug msg="pinging registry endpoint https://registry-win-tp3.docker.io/v1/" time="2015-11-17T03:20:58.169084660Z" level=debug msg="attempting v1 ping for registry endpoint https://registry-win-tp3.docker.io/v1/" time="2015-11-17T03:20:58.898542338Z" level=debug msg="Error unmarshalling the _ping PingResult: invalid character '<' looking for beginning of value" time="2015-11-17T03:20:58.898803841Z" level=debug msg="PingResult.Version: \"\"" time="2015-11-17T03:20:58.898818084Z" level=debug msg="Registry standalone header: ''" time="2015-11-17T03:20:58.898836197Z" level=debug msg="PingResult.Standalone: true" time="2015-11-17T03:20:58.898853685Z" level=debug msg="attempting v1 login to registry endpoint https://registry-win-tp3.docker.io/v1/" time="2015-11-17T03:20:59.478756938Z" level=error msg="Handler for POST /v1.21/auth returned error: Unexpected status code [403] : <html><body><h1>403 Forbidden</h1>\nRequest forbidden by administrative rules.\n</body></html>\n\n" time="2015-11-17T03:20:59.478815334Z" level=error msg="HTTP Error" err="Unexpected status code [403] : <html><body><h1>403 Forbidden</h1>\nRequest forbidden by administrative rules.\n</body></html>\n\n" statusCode=500 

Trying to solve the problem, I tried to launch docker login ... from the built-in Docker virtual machine. And there it works!

 ### VIA default virtual machine (192.168.99.100) ### docker login --username=myuser --password="mypass" --email=myemail@gmail.com https://index.docker.io/v1/ time="2015-11-17T03:20:46.053333255Z" level=debug msg="Calling POST /v1.21/auth" time="2015-11-17T03:20:46.053404176Z" level=info msg="POST /v1.21/auth" time="2015-11-17T03:20:46.082796012Z" level=debug msg="hostDir: /etc/docker/certs.d/https:/index.docker.io/v1" time="2015-11-17T03:20:46.082930763Z" level=debug msg="pinging registry endpoint https://index.docker.io/v1/" time="2015-11-17T03:20:46.082946790Z" level=debug msg="attempting v1 ping for registry endpoint https://index.docker.io/v1/" time="2015-11-17T03:20:46.082959103Z" level=debug msg="attempting v1 login to registry endpoint https://index.docker.io/v1/" 

I noticed that they use two different URLs and the first one encounters a parsing error. Credentials are obviously correct as they work from VM, unless two domains use users. Are the URLs or response malformed by MINGW64?

+7
docker docker-toolbox
source share
1 answer

February 2016 update

PR 19891 "Enable logon to register on different platforms" should fix the problem

Use the daemon-assigned registry URL to log into docker.

This allows the Windows client interacting with the Linux daemon to correctly use the default registry endpoint instead of the specific Windows.

To commit 19eaa71 (perhaps for docker 1.10?)


This is reported as in the question about docker / docker 15612 and docker / docker issue 18019

After some analysis of the source code, Ive discovered that we have different registry URLs for Windows and UNIX.

The Windows URL comes from a recent PR 15417 with a comment:

 // Currently it is a TEMPORARY link that allows Microsoft to continue // development of Docker Engine for Windows. 

Thus, it is possible that this URL will not work (unless you are using the latest Windows Server 2016)


There seems to be a 473 issue in docker/hub-feedback , which includes:

  • specifying the default registry index for docker io,

     docker login --username=myuser --password=mypassword --email=myemail https://index.docker.io/v1/ WARNING: login credentials saved in C:\Users\myuser\.docker\config.json Login Succeeded 
  • modifying the config.json file created in the previous step to add the same credentials for index.docker.io for registry-win :

config.json :

 { "auths": { "https://index.docker.io/v1/": { "auth": "myhash", "email": "myemail" }, "https://registry-win-tp3.docker.io/v1/": { "auth": "myhash", "email": "mydomain" } } } 

After that, docker push index.docker.io/myuser/myrepo:latest .

+8
source share

All Articles