我已经在Windows8.1中安装了Docker,并且一直在遵循安装教程。当进入创造并推动你自己的形象e的步骤时,当我试图运行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 为了解决这个问题,我尝试在Docker默认VM中运行docker login ...。它就在那儿工作!
### 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/" 我注意到它们使用的是两个不同的URL,第一个遇到了解析错误。凭据显然是正确的,因为它们在VM中工作,除非这两个域不共享用户。MINGW64是否破坏了URL或响应?
发布于 2015-11-17 05:38:46
2016年2月更新
PR 19891“启用跨平台登录到注册表”应该解决这个问题
使用守护进程定义的注册表URL进行停靠登录。 这允许与Linux守护进程交互的Windows客户端正确地使用默认注册表端点而不是特定于Windows的端点。
它在19 71 (也许是码头1.10?)
这在码头/码头第15612期和码头/码头第18019期中都有报道。
在对源代码进行了一些分析之后,我发现我们对于Windows和UNIX有不同的注册表URL。
Windows来自一个带有注释的最近PR 15417:
// Currently it is a TEMPORARY link that allows Microsoft to continue
// development of Docker Engine for Windows.因此,这个url可能无法工作(除非您使用的是最近的Windows 2016)
在问题473中似乎有一个解决办法,其中包括:
config.json文件,以便为index.docker.io添加与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"
}
}
}在此之后,docker push index.docker.io/myuser/myrepo:latest就可以工作了。
https://stackoverflow.com/questions/33748919
复制相似问题