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

denied: requested access to the resource is denied

注:我已成功登录docker


当前回答

之前的答案都是正确的,我只是想补充一个我看到没有提到的信息;

如果项目是私有项目,要正确地推送映像,必须配置个人访问令牌或启用read_registry key的部署令牌。

来源:https://gitlab.com/help/user/project/container_registry using-with-private-projects

希望这是有帮助的(如果问题是张贴到目前为止的时间)

其他回答

从应用程序登录。我一直在尝试从终端没有运气。

这是版本17.06.1

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

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,它工作了

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

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

如果您遇到类似的情况(使用任何类型的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

更多细节请看这个答案。

我也有同样的问题。在我的情况下,我登录在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

的问候。