未经授权的docker:需要身份验证-成功登录后推送

从主机推送docker映像(成功登录后)时,我得到“未授权:需要身份验证”。

详细信息如下。

-bash-4.2# docker login --username=asamba --email=anand.sambamoorthy@gmail.com

WARNING: login credentials saved in /root/.docker/config.json

*Login Succeeded*

-bash-4.2#

-bash-4.2# docker push asamba/docker-whale

Do you really want to push to public registry? [y/n]: y

The push refers to a repository [docker.io/asamba/docker-whale] (len: 0)

faa2fa357a0e: Preparing

unauthorized: authentication required

  • Docker版本:1.9.1(客户端和服务器)
  • http://hub.docker.com也创建了存储库(asamba / docker-whale)。

/ var / log / messages显示403,我不知道这个docker是否。见下文。

Apr 16 11:39:03 localhost journal: time="2016-04-16T11:39:03.884872524Z" level=info msg="{Action=push, Username=asamba, LoginUID=1001, PID=2125}"

Apr 16 11:39:03 localhost journal: time="2016-04-16T11:39:03.884988574Z" level=error msg="Handler for POST /v1.21/images/asamba/docker-whale/push returned error: Error: Status 403 trying to push repository asamba/docker-whale to official registry: needs to be forced"

Apr 16 11:39:03 localhost journal: time="2016-04-16T11:39:03.885013241Z" level=error msg="HTTP Error" err="Error: Status 403 trying to push repository asamba/docker-whale to official registry: needs to be forced" statusCode=403

Apr 16 11:39:05 localhost journal: time="2016-04-16T11:39:05.420188969Z" level=info msg="{Action=push, Username=asamba, LoginUID=1001, PID=2125}"

Apr 16 11:39:06 localhost kernel: XFS (dm-4): Mounting V4 Filesystem

Apr 16 11:39:06 localhost kernel: XFS (dm-4): Ending clean mount

Apr 16 11:39:07 localhost kernel: XFS (dm-4): Unmounting Filesystem

感谢您的帮助,如果您需要更多信息,请告诉我。我也使用-f进行了推送。没运气!

回答:

好!没关系; 我找到了解决方案。403怀疑HTTP不能到达正确的URL。

更改已将登录凭据存储为的文件(~/.docker/config.json从生成的默认值)

{

"auths": {

"docker.io": {

"auth": "XXXXXXXXXXXXX",

"email": "x.y@gmail.com"

}

}

}

到-注意从docker.io-> index.docker.io/v1所做的更改。那是变化。

{

"auths": {

"https://index.docker.io/v1/": {

"auth": "XXXXXXXXXXXXX",

"email": "x.y@gmail.com"

}

}

}

希望能有所帮助。

请注意,auth字段应使用’username:password’base64编码。例如:“ username:password” base64编码为“

dXNlcm5hbWU6cGFzc3dvcmQ =”

因此您的文件将包含:

"auth": "dXNlcm5hbWU6cGFzc3dvcmQ="

以上是 未经授权的docker:需要身份验证-成功登录后推送 的全部内容, 来源链接: utcz.com/qa/425711.html

回到顶部