可以登录docker-registry但不能推送映像(github)

时间:2020-02-09 14:02:45

标签: docker github docker-registry github-package-registry

所以我想使用GitHub上的docker注册表。 我顺其自然:

docker login docker.pkg.github.com --username username
docker build . --tag docker.pkg.github.com/user-name/repo/IMAGENAME:snapshot
docker push docker.pkg.github.com/user-name/repo/IMAGENAME:snapshot

请注意,该存储库是私有的,不是我的,但我对此拥有写权限。

当我转到程序包选项卡时,我还可以看到有关如何开始使用的说明,并按照它们进行操作(有点,我一口气就标记了Docker映像)。

但是当我在顶部运行3个命令时,我得到以下输出(push命令失败):

unauthorized: Your token has not been granted the required scopes to execute this query. The 'id' field requires one of the following scopes: ['read:packages'], but your token has only been granted the: [''] scopes. Please modify your token's scopes at: https://github.com/settings/tokens.

当我访问所引用的网站时,只有无关的令牌没有任何东西。

有什么主意我可以尝试或可能导致此问题的原因吗?

1 个答案:

答案 0 :(得分:0)

您需要使用API​​令牌登录,如文档中所示。无法通过密码登录。 https://help.github.com/en/packages/using-github-packages-with-your-projects-ecosystem/configuring-docker-for-use-with-github-packages

您必须使用个人访问令牌。

相关问题