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

denied: requested access to the resource is denied

注:我已成功登录docker


当前回答

在尝试了每个高分解决方案后,我仍然没有运气。

直到我改变了我的重点和搜索关键字,包括我的凭证助手通行证。

如果您遇到类似的情况(使用任何类型的docker-credential-helpers,并遵循一般指导原则进行设置),请尝试检查步骤,看看是否遗漏了任何内容。

例如,我使用pass作为docker的凭据库,当我只是按照顶部搜索结果设置pass时,错过了为专用的pass-name docker- credial -helpers/docker-pass- initialization -check插入我的dockerhub帐户密码的步骤。

在发出以下命令后,docker push终于对我发了慈悲。

pass insert docker-credential-helpers/docker-pass-initialized-check

更多细节请看这个答案。

其他回答

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

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

在使用Gitlab注册表时,我还遇到了这个错误消息。不同之处在于,我试图从以前的构建中更改映像的名称。这里的问题是,推送图像的注册表不存在,因为图像的新名称与我组中的任何项目都不匹配。

TLDR:在Gitlab中,映像名称必须与项目名称匹配。

我得到了同样的错误。不幸的是,这个错误是由于在docker push之前使用sudo造成的。此外,您可能需要从dockerhub中删除存储库,因为您可以拥有的repo数量是有限的。并且,请尝试docker注销,然后docker登录

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

我也有同样的问题。在我的情况下,我登录在index.docker.io,并将图像推到docker.io/username/image:标签。

解决方案是在docker中登录。IO通过运行这个命令:

export CI_REGISTRY=docker.io
docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY
docker push USERNAME/IMAGE:TAG

输出为:

The push refers to repository [docker.io/USERNAME/IMAGE:TAG] eeb7e16c6369: Preparing 6bd09f46d0ae: Preparing f5a7f7a3fb28: Preparing 07952c1df7f6: Preparing a4522c0d203b: Preparing 3e207b409db3: Preparing 3e207b409db3: Waiting a4522c0d203b: Layer already exists 3e207b409db3: Layer already exists f5a7f7a3fb28: Pushed 6bd09f46d0ae: Pushed 07952c1df7f6: Pushed eeb7e16c6369: Pushed latest: digest: sha256:7ce256fa83ef1eebcaaaa460c4d73f87f2adf304bc6e6c1b83a19d987cd61ad5 size: 1579 Running after_script 00:02 Saving cache 00:01 Uploading artifacts for successful job 00:02 Job succeeded

的问候。