我想将一个镜像推送到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-token
通过Gitlab CI进行操作时,我可以正常推送。
我还尝试重新生成新的token,但仍然存在同样的问题。
我该如何解决?