denied: requested access to the resource is denied when I try to push my Docker image to my DockerHub repository

huangapple go评论59阅读模式
英文:

denied: requested access to the resource is denied when I try to push my Docker image to my DockerHub repository

问题

以下是您提供的文本的翻译部分:

我有一些用于制作文档文件(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
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

所以,我是silverchair!而且我已登录。

(venv) remplacement@remplacements-MacBook-Pro SugiPerso % docker login
认证成功...
登录成功

使用密码登录将赋予您的终端对您的帐户的完全访问权限。出于更好的安全性考虑,建议使用有限权限的个人访问令牌进行登录。请在 https://docs.docker.com/go/access-tokens/ 了解更多信息。

我尝试验证指定我的用户名,但即使我确定我的密码是正确的(这是我在 hub.docker.com 上使用的密码),也无法登录。

(venv) remplacement@remplacements-MacBook-Pro SugiPerso % docker login -u silverchair
密码:
来自守护程序的错误响应:Get "https://registry-1.docker.io/v2/": 未经授权:用户名或密码不正确

我尝试创建个人访问令牌,但仍然遇到了错误。

(venv) remplacement@remplacements-MacBook-Pro SugiPerso % docker login -u sliverchair
密码:
登录成功

使用密码登录将赋予您的终端对您的帐户的完全访问权限。出于更好的安全性考虑,建议使用有限权限的个人访问令牌进行登录。请在 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

英文:

I have images of a code that makes summaries of document files (pdf, docx ...). I created a Docker image that I wanted to share online on Dockerhub. But strangely I am getting rejected with an access denied.

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

So, I am silverchair! And I logged in.

(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/

I tried to verify specifying my username, but I can't log in even if I'm sure of my password (it's the one I use for 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

I tried creating a personnal access token but still got the error:

(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

答案1

得分: 1

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

% docker login -u sliverchair
Password: 
Login Succeeded

...

% docker push silverchair/summarize:latest

您需要将您的镜像标记为 sliverchair/summarize:latest 而不是 silverchair/summarize:latest,以便能够推送到您的用户存储库。

英文:

The error is because you have a typo in your username:

% docker login -u sliverchair
Password: 
Login Succeeded

...

% docker push silverchair/summarize:latest

You need to tag your image with sliverchair/summarize:latest instead of silverchair/summarize:latest to be able to push to your user's repositories.


[ Original answer ]

This shows that you are not logged in with that user:

>
> (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
>

Login to Docker Hub (with username silverchair), and in your user settings generate a personal access token. Use this token to login. A PAT is required if you have enabled 2FA. If you cannot login to Hub with that username, double check that you entered the correct username and password.

huangapple
  • 本文由 发表于 2023年3月7日 03:56:52
  • 转载请务必保留本文链接:https://go.coder-hub.com/75655281.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定