docker - 拒绝:将图像推送到 gitlab 注册表时请求的资源访问被拒绝
问题描述
我正在尝试将图像推送到 gitlab 注册表。
我已经做过很多次了,所以我想知道为什么会出现这个错误。
我用最新标签构建图像:
Successfully tagged registry.gitlab.com/mycompany/rgpd_api:latest
然后我登录并推送:
docker login registry.gitlab.com -u gitlab+deploy-token-91931
docker push registry.gitlab.com/mycompany/rgpd_api:latest
但我得到:
The push refers to repository [registry.gitlab.com/mycompany/rgpd_api]
be679cc302b9: Preparing
denied: requested access to the resource is denied
我给了gitlab+deploy-token-91931
令牌read_repository
和read_registry
权利。
我的回购是:
https://gitlab.com/mycompany/rgpd_api
我检查了文档页面:https ://docs.gitlab.com/ee/user/project/container_registry.html
但是当我通过 Gitlab CI 进行操作时,使用gitlab-ci-token
我可以正常推。
我也尝试重新生成一个新令牌,但仍然是同样的问题。
我该如何解决?
解决方案
我的错误是使用部署令牌将图像推送到注册表。
部署令牌可用于拉取镜像,但不能推送。
因此,您可以生成个人访问令牌。您应该至少添加权限:
read_registry, write_registry
推荐阅读
- wso2 - WSO2 Siddhi DynamoDB 存储扩展
- r - 如果列中的值以...开头,则在 R 中使用给定文本改变另一列
- angular - 基于模板值的 Kendo UI Grid 样式单元格
- python - 逗号作为python中的小数点
- c# - 通过组合框选定项填充其他控件 asp.net core Razor Page
- azure - 如何报告我的每个容器的使用量?
- regular-language - 编写描述集合的正则表达式
- perl - 带有 message_string() 函数的错误 IMAPClient
- sequelize.js - 为受约束的关联起别名
- mysql - 什么是 SCHEMA_MIGIMP..MIGRATION_STATUS?