当从我的主机推送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 (客户端和server)
/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做了推送。不走运!
发布于 2016-04-16 20:27:05
好的!不要紧,我已经找到解决方案了。403怀疑HTTP不会到达正确的URL。
将存储有登录凭据的文件的~/.docker/config.json
从默认生成的
{
"auths": {
"docker.io": {
"auth": "XXXXXXXXXXXXX",
"email": "x.y@gmail.com"
}
}
}
to -注意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="
发布于 2016-09-22 02:54:32
您需要登录到Docker。
第1步:登录到docker hub
根据@KaraPirinc的评论,在Docker版本17中,为了登录:
docker login -u username --password-stdin
然后在系统提示时输入您的密码。
步骤2:在docker hub中创建存储库。
比方说"mysqlserver:sql".
docker push <user username>/mysqlserver:sql
发布于 2016-04-29 21:28:28
你发布的解决方案对我不起作用...
以下是对我有效的方法:
<dockerusername>/desired-name
。例如,radu/desired-name
.https://stackoverflow.com/questions/36663742
复制相似问题