Docker 从 Codespaces 登录 Github 包导致访问被拒绝

问题描述 投票:0回答:1

我正在 Github 代码空间工作,我想登录 github 包。

以下方式适用于我的笔记本电脑,但是当我尝试从 Codespaces 登录时,我得到

Error response from daemon: Get "https://ghcr.io/v2/": denied: denied

export GH_TOKEN="<github-personal-access-token>"  
export GH_USER="user-name"
echo "$GH_TOKEN" | docker login ghcr.io -u "$GH_USER" --password-stdin
docker containers github-codespaces github-packages
1个回答
0
投票

在 Github Codespaces 上,在命令中使用预定义的环境变量:

echo "$GITHUB_TOKEN" | docker login ghcr.io -u "$GITHUB_USER" --password-stdin

查看所有运行的环境变量

env | grep GITHUB

© www.soinside.com 2019 - 2024. All rights reserved.