我正在按照这个链接创建我的第一个docker映像,它成功了,现在我试图从这个链接将这个映像推到我的docker存储库中。但是每当我试图将这个映像推入存储库时,我就会得到这种类型的错误。

denied: requested access to the resource is denied

注:我已成功登录docker


当前回答

我也有这个问题,我测试了这里的解决方案,但无济于事,我已经正确登录,至少根据docker登录的输出,但我仍然无法推送图像。最终奏效的方法很简单:

码头工人注销

然后docker登录,就这么简单。我不知道发生了什么,但强迫重新登录起作用了。

其他回答

还需要注意的重要一点是,在标记图像时,首先使用命名空间标记,然后使用存储库/ mydevrepo标记。这让我在使用Docker文档时感到困惑。之后我使用:

docker login

然后我使用“tagged name”来推送我的图像。

docker push {namespace}/mydevrepo

我在ibmcloud上也遇到了同样的错误。我添加了命名空间,然后试图推动我的图像,它解决了这个问题。

ibmcloud cr namespace-add txts

在我的例子中,sudo -E处理此消息失败。解决方案是提供访问do docker而不使用sudo(创建一个组docker,将(Jenkins)用户添加到组中,将组设置在/var/run/docker.sock上)。现在docker push不需要sudo了,而且可以工作。

我的问题是在我的图像名称中使用无效字符(额外的/):

myusername/something/image

无效的映像名称。/上的用户名都尝试dangillmor something-image。希望这能帮助到一些人。

如果您已经登录,如果您仍然得到错误。请按照步骤操作,

PS C:\Users\rohit\Docker> docker logout
Removing login credentials for https://index.docker.io/v1/

PS C:\Users\rohit\Docker> docker login
Login with your Docker ID to push and pull images from Docker Hub. If you don't have a Docker ID, head over to https://hub.docker.com to create one.
Username: rohithpoya
Password:*****************
Login Succeeded

Logging in with your password grants your terminal complete access to your account.
For better security, log in with a limited-privilege personal access token. Learn more at https://docs.docker.com/go/access-tokens/

PS C:\Users\rohit\Docker> docker push rohithpoya/mongo-enterprise:5                                                                                                                                                                       
The push refers to repository [docker.io/rohithpoya/mongo-enterprise]                                                                                                                                                                        83ee27b8fe98: Pushed