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

denied: requested access to the resource is denied

注:我已成功登录docker


当前回答

DR docker登录在macOS上不工作,但从应用程序的docker登录工作

当直接从终端使用时,命令docker登录成功地要求我的凭据,在我正确输入它们之后(记住没有电子邮件,只有docker ID将工作),它宣布登录成功,但任何推送请求将以拒绝告终:请求访问资源被拒绝

然而,当我从正在运行的macOs docker应用程序登录时(工具栏中的图标),它工作了。因此,docker登录和运行的docker应用程序/守护进程之间可能会有一些不一致

其他回答

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

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

您可能需要在docker push之前将docker repo切换为private。

感谢Dean Wu提供的答案和ses的评论,在推送之前,请记得注销,然后从命令行登录到您的docker hub帐户

# you may need log out first `docker logout` ref. https://stackoverflow.com/a/53835882/248616
docker login

根据文件:

You need to include the namespace for Docker Hub to associate it with your account.
The namespace is the same as your Docker Hub account name.
You need to rename the image to YOUR_DOCKERHUB_NAME/docker-whale.

所以,这意味着你必须在推送之前标记你的图像:

docker tag firstimage YOUR_DOCKERHUB_NAME/firstimage

然后你就可以推它了。

docker push YOUR_DOCKERHUB_NAME/firstimage

步骤1:修改docker帐号的隐私模式

https://hub.docker.com/settings/default-privacy

第二步:执行屏幕短片中提到的以下命令:

码头工人的图片 docker tag <<TAG_ID>> <<USER_NAME>>/<<IMAGE_NAME>>:最新的 Docker登录Docker .io docker push <<USER_NAME>>/<<IMAGE_NAME>>:最新的

输出:

我也有这个问题。事实证明,我使用的是免费层,并试图在私有存储库中推送多个图像。将一张图片设为私有,其余的设为公共,这对我来说很管用。

Docker对私有存储库的数量也有限制。如果您正在通过从本地机器推入创建私有存储库,则它将创建存储库,但不能再向其推入或从其拉出任何其他内容,并且您将得到“对资源的请求访问被拒绝”错误。