拒绝:当我尝试将Docker映像推送到DockerHub存储库时,请求的资源访问被拒绝

2fjabf4q  于 2023-03-17  发布在  Docker
关注(0)|答案(1)|浏览(826)

我有一个代码的图像,使文档文件(pdf,docx...)的摘要。我创建了一个Docker图像,我想在Dockerhub上在线分享。但奇怪的是,我被拒绝访问拒绝。

remplacement@remplacements-MacBook-Pro SugiPerso % docker images
REPOSITORY                       TAG       IMAGE ID       CREATED        SIZE
google-drive-stats               latest    3ee6041a35da   2 hours ago    7.99GB
silverchair/google-drive-stats   latest    3ee6041a35da   2 hours ago    7.99GB
silverchair/summarize            latest    3ee6041a35da   2 hours ago    7.99GB
silverchair/summarizer           latest    3ee6041a35da   2 hours ago    7.99GB
<none>                           <none>    0fd8ba0a03d0   2 days ago     8.77GB
docker/getting-started           latest    289dc403af49   2 months ago   46.5MB
remplacement@remplacements-MacBook-Pro SugiPerso % docker push silverchair/summarize:latest
The push refers to repository [docker.io/silverchair/summarize]
b3e8d2260244: Preparing 
f23ef5b31c37: Preparing 
7b23b0f1ac1c: Preparing 
525da3ba2310: Preparing 
f6f8f61b9120: Preparing 
2546a271e121: Waiting 
646584c2f409: Waiting 
cfb461ef999f: Waiting 
416936900c68: Waiting 
0a39acbc2a98: Waiting 
2b6d33d15c9f: Waiting 
edf70074bd40: Waiting 
denied: requested access to the resource is denied

我就是银椅!我登录了。

(venv) remplacement@remplacements-MacBook-Pro SugiPerso % docker login                                              
Authenticating with existing credentials...
Login Succeeded

Logging in with your password grants your terminal complete access to your account. 
For better security, log in with a limited-privilege personal access token. Learn more at https://docs.docker.com/go/access-tokens/

我试图验证指定我的用户名,但我无法登录,即使我确定我的密码(这是我用于hub.docker.com):

(venv) remplacement@remplacements-MacBook-Pro SugiPerso % docker login -u silverchair
Password: 
Error response from daemon: Get "https://registry-1.docker.io/v2/": unauthorized: incorrect username or password

我尝试创建个人访问令牌,但仍然得到错误:

(venv) remplacement@remplacements-MacBook-Pro SugiPerso % docker login -u sliverchair
Password: 
Login Succeeded

Logging in with your password grants your terminal complete access to your account. 
For better security, log in with a limited-privilege personal access token. Learn more at https://docs.docker.com/go/access-tokens/
(venv) remplacement@remplacements-MacBook-Pro SugiPerso % docker push silverchair/summarize:latest
The push refers to repository [docker.io/silverchair/summarize]
b3e8d2260244: Preparing 
f23ef5b31c37: Preparing 
7b23b0f1ac1c: Preparing 
525da3ba2310: Preparing 
f6f8f61b9120: Preparing 
2546a271e121: Waiting 
646584c2f409: Waiting 
cfb461ef999f: Waiting 
416936900c68: Waiting 
0a39acbc2a98: Waiting 
2b6d33d15c9f: Waiting 
edf70074bd40: Waiting 
denied: requested access to the resource is denied
ovfsdjhp

ovfsdjhp1#

错误是因为您的用户名中有拼写错误:

% docker login -u sliverchair
Password: 
Login Succeeded

...

% docker push silverchair/summarize:latest

您需要使用sliverchair/summarize:latest而不是silverchair/summarize:latest标记图像,以便能够推送到用户的存储库。
[原答复]
这表明您未使用该用户登录:

(venv) remplacement@remplacements-MacBook-Pro SugiPerso % docker login -u silverchair
Password: 
Error response from daemon: Get "https://registry-1.docker.io/v2/": unauthorized: incorrect username or password

登录Docker Hub(使用用户名silverchair),并在您的用户设置中生成个人访问令牌。使用此令牌登录。如果启用了2FA,则需要PAT。如果无法使用该用户名登录Hub,请仔细检查是否输入了正确的用户名和密码。

相关问题