在成功(至少根据命令输出)使用 docker.pkg.github.com 对 Docker 进行身份验证后,
λ cat ~/.github/packages-token.txt | docker.exe login -u tomasaschan --password-stdin docker.pkg.github.com
Login Succeeded
我尝试将我的图像推送到 Github,但它失败了:
λ docker.exe push docker.pkg.github.com/tomasaschan/vscode-devcontainers/haskell:0.1
The push refers to repository [docker.pkg.github.com/tomasaschan/vscode-devcontainers/haskell]
5fdec462bfdd: Preparing
7d011632d389: Preparing
ee33ab0520f7: Preparing
c2dc9b7d0afb: Preparing
e3cd6c1b7a6f: Preparing
85a531a5f8ac: Waiting
33824b0902b0: Waiting
7a02eb6fb081: Waiting
97499bae1648: Waiting
ed55a3118900: Waiting
97b8ab1c4a52: Waiting
bbd0d835d261: Waiting
5ee6297cd05f: Waiting
3b6e130eaa4b: Waiting
05f3b67ed530: Waiting
ec1817c93e7c: Waiting
9e97312b63ff: Waiting
e1c75a5e0bfa: Waiting
unauthorized: Your request could not be authenticated by the GitHub Packages service. Please ensure your access token is valid and has the appropriate scopes configured.
据我所知,我的 Docker 配置看起来很正常(请注意,我在docker.exe
上面使用的是不必担心它从哪里读取配置):
λ cat /mnt/c/Users/tomasl/.docker/config.json
{
"auths": {
"docker.pkg.github.com": {},
"https://index.docker.io/v1/": {}
},
"HttpHeaders": {
"User-Agent": "Docker-Client/19.03.8 (windows)"
},
"credsStore": "desktop",
"credHelpers": {
"asia.gcr.io": "gcloud",
"eu.gcr.io": "gcloud",
"gcr.io": "gcloud",
"marketplace.gcr.io": "gcloud",
"staging-k8s.gcr.io": "gcloud",
"us.gcr.io": "gcloud"
},
"stackOrchestrator": "swarm"
}
我需要做什么才能将 Docker 映像推送到 docker.pkg.github.com?