简体   繁体   English

无法将Docker映像推送到gitlab:拒绝:请求的对资源的访问被拒绝

[英]Impossible to push docker images to gitlab: denied: requested access to the resource is denied

First of all, I must tell this is an operation I have done many times, with no issues. 首先,我必须告诉我这是我已完成多次的操作,没有任何问题。

I have a docker image registry.gitlab.com/company/metadata_api with dev tag. 我有一个带dev标签的docker image registry.gitlab.com/company/metadata_api

➜  metadata_api git:(no_basic_auth) ✗ docker images | grep registry.gitlab.com/company/metadata_api
    registry.gitlab.com/company/metadata_api           dev                 80cdbdb33ec9        7 minutes ago       12.2MB
    registry.gitlab.com/company/metadata_api           latest              d9918d874a55        3 weeks ago         12.3MB

I have a deploy token for the project with both scopes read_repository, read_registry 我有两个范围为read_repository, read_registry的项目的部署令牌

I also have a global personal access token that I will use to discard rigths issues 我还有一个全局个人访问令牌,将用于丢弃严重性问题

➜  metadata_api git:(no_basic_auth) ✗ docker login registry.gitlab.com -u oauth2 
Password: 
Login Succeeded

When I try to push, I get : 当我尝试推动时,我得到:

requested access to the resource is denied

Why ? 为什么呢

➜  metadata_api git:(no_basic_auth) ✗ docker push registry.gitlab.com/company/metadata_api:dev
The push refers to repository [registry.gitlab.com/company/metadata_api]
a9ae54b0eb8c: Preparing 
denied: requested access to the resource is denied

I have a deploy token for the project with both scopes read_repository , read_registry 我有两个范围为read_repositoryread_registry的项目的部署令牌

[...] [...]

When I try to push, I get : requested access to the resource is denied 当我尝试推送时,我得到: requested access to the resource is denied

You lack the proper scope to push to registry (you only have read permission). 您没有适当的范围来推送到注册表(您只有读取权限)。 With deploy token s you cannot push to registry, as per Gitlab indication on the Deploy Token page: 使用deploy token s时,无法按照Gitlab在“部署令牌”页面上的指示推送到注册表:

Deploy tokens allow read-only access to your repository and registry images. 部署令牌允许对存储库和注册表映像进行只读访问

There an open issue for write_registry permissions on registry for Deploy Tokens being discussed. 讨论中的部署令牌在注册表上的write_registry权限存在一个未解决的问题

Maybe try using an access token with scope api 也许尝试使用带有作用域apiaccess token

我重新启动了计算机,它正常工作了!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM