gpt4 book ai didi

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

转载 作者:行者123 更新时间:2023-12-02 19:51:55 26 4
gpt4 key购买 nike

所以我想使用来自 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

请注意,存储库是私有(private)的,不是我的,但我获得了对它的写入权限。

当我转到包选项卡时,我还可以看到有关如何开始的说明并按照它们进行操作(有点,我一次性标记了 docker 图像)。

但是当我在顶部运行 3 个命令时,我得到以下输出(推送命令失败):
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.

当我访问所引用的站点时,只有不相关的 token 什么都没有。

我可以尝试什么或可能导致这种情况的任何想法......?

最佳答案

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

You must use a personal access token.

关于docker - 可以登录到 docker-registry 但不能推送图像(github),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/60137402/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com