当前位置: 首页 > 知识库问答 >
问题:

docker unauthorized:需要身份验证-成功登录后推送

甄德寿
2023-03-14

在从主机推送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(客户端和服务器)

/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推了推。不走运!

共有3个答案

邢飞白
2023-03-14

你发布的解决方案对我不起作用...

这对我来说很有用:

>

  • 使用所需的名称创建存储库。

    提交映像时,将映像命名为存储库,包括用户名

  • 华星剑
    2023-03-14

    好啊不要介意;我找到了解决办法。与403一起,我们怀疑HTTP没有连接到正确的URL。

    从默认生成的更改具有存储~/. docker/config.json的登录凭据的文件

    {
            "auths": {
                    "docker.io": {
                            "auth": "XXXXXXXXXXXXX",
                            "email": "x.y@gmail.com"
                    }
            }
    }
    

    到-注意从docker.io的变化-

    {
            "auths": {
                    "https://index.docker.io/v1/": {
                            "auth": "XXXXXXXXXXXXX",
                            "email": "x.y@gmail.com"
                    }
            }
    }
    

    希望有帮助。

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

    因此,您的文件将包含:

    "auth": "dXNlcm5hbWU6cGFzc3dvcmQ="
    
    欧阳鸿德
    2023-03-14

    你需要登录Docker。

    根据@KaraPirinc的评论,在Docker版本17中,为了登录:

    docker login -u username --password-stdin
    

    然后在询问时输入密码。

    让我们说“mysqlserver: sql”。

    docker push <user username>/mysqlserver:sql
    
     类似资料:
    • 问题内容: 从主机推送docker映像(成功登录后)时,我得到“未授权:需要身份验证”。 详细信息如下。 Docker版本:1.9.1(客户端和服务器) http://hub.docker.com也创建了存储库(asamba / docker-whale)。 / var / log / messages显示403,我不知道这个docker是否。见下文。 感谢您的帮助,如果您需要更多信息,请告诉我。

    • 我遵循了GitHub教程中的所有内容:https://help.github.com/articles/generating-ssh-keys 我在存储库的目录中执行了所有命令。我成功到达教程的末尾,并收到消息:“嗨,用户名!你已成功通过身份验证,但 GitHub 不提供外壳访问。 然而,当我尝试做推送之类的事情时,它仍然要求输入我的用户名和密码。

    • 问题内容: 我想在我的Django编码网站中添加一些Ajax -niceness。 在我的Django代码中,我使用装饰器标记哪个视图需要认证。未经身份验证的用户单击时的默认行为是将其重定向到登录页面,然后传递目标页面。 我在某些网站上看到的,并且真正喜欢的是,当用户单击一个指向仅限于登录用户的位置的链接时,他/她得到了一个弹出窗口(通过JavaScript),而不是重定向到登录页面,而是询问他/

    • 使用,https://github.com/firebase/FirebaseUI-Android/tree/master/codelabs/chat作为登录的参考,我在键入时似乎遇到了问题 我只能键入Auth的提供者,而不能键入,为什么会这样,它提示我键入社会提供者。

    • 我有一个基本的apache2.4 HTTP Web服务器和tomcat7应用服务器。CA Siteminder Webagent在HTTP Webserver中配置,并使用mod\u代理将流量传递给应用程序服务器。当用户成功登录到SSO并将请求传递给部署在tomcat中的webapplication时,即要求标准的tomcat登录。 如何停止询问tomcat标准登录,以及如何在使用sitemind

    • 我试图在登录symfony2应用程序后实现重定向,以便在我的用户是否有一个属性时重定向。我已在项目的Handler文件夹中创建了AuthenticationSuccessHandler.php类: 但是当我登录时,我得到一个错误: 注意:未定义的属性:Me\MyBundle\Handler\AuthenticationSuccessHandler::$router in/var/www/MyBun