拒绝:请求的对资源的访问被拒绝:泊坞窗

本文翻译自:denied: requested access to the resource is denied : docker

I am following this link to create my first docker Image and it went successfully and now I am trying to push this Image into my docker repository from this link . 我正在跟踪此链接以创建我的第一个Docker映像,该映像成功进行了,现在我正尝试通过此链接将此映像推送到我的docker存储库中。 But whenever I am trying to push this Image into repository , I got this type of error. 但是,每当我尝试将此映像推送到存储库中时,都会出现此类错误。

denied: requested access to the resource is denied

在此处输入图片说明

Could anyone give me some hint towards this problem ? 有人可以给我一些有关这个问题的提示吗? Any help would appreciated. 任何帮助,将不胜感激。

Note: I have successfully login into docker 注意:我已成功登录docker


#1楼

参考:https://stackoom.com/question/2qA3j/拒绝-请求的对资源的访问被拒绝-泊坞窗


#2楼

Thanks to the answer provided by Dean Wu and this comment by ses , before pushing, remember to log in from the command line to your docker hub account 感谢Dean Wu提供的答案ses的 注释 ,在推送之前,请记住从命令行登录到您的docker hub帐户

docker login

According to the docs : 根据文档

You need to include the namespace for Docker Hub to associate it with your account.
The namespace is the same as your Docker Hub account name.
You need to rename the image to YOUR_DOCKERHUB_NAME/docker-whale.

So, this means you have to tag your image before pushing: 因此,这意味着您必须在推送之前标记图像:

docker tag firstimage YOUR_DOCKERHUB_NAME/firstimage

and then you should be able to push it. 然后您应该可以推动它。

docker push YOUR_DOCKERHUB_NAME/firstimage

#3楼

The way docker handles user IDs and repositories may be a bit confusing. docker处理用户ID和存储库的方式可能会有些混乱。 Let's say you create a user account xyz on docker hub. 假设您在Docker Hub上创建了一个用户帐户xyz。 The new account automatically establishes a namespace xyz . 新帐户将自动建立命名空间xyz Then you create a repository called myrepo. 然后,您创建一个名为myrepo的存储库。 The repository name will actually be xyz/myrepo . 存储库名称实际上是xyz/myrepo

To push an image you should do: 要推送图像,您应该执行以下操作:

docker push docker.io/xyz/myrepo

You can add ":latest" or a different tag if necessary. 您可以根据需要添加“:latest”或其他标签。

If you get the requested access to the resource is denied error message: 如果您获得对requested access to the resource is deniedrequested access to the resource is denied错误消息:

  1. Go to https://hub.docker.com/ and sign in as xyz. 转到https://hub.docker.com/并以xyz身份登录。
  2. Click on your repository xyz/myrepo. 单击您的存储库xyz / myrepo。
  3. Click on Collaborators. 单击协作者。
  4. Add xyz as a collaborator. 将xyz添加为协作者。

#4楼

I got the same issue while taking the docker beginner Course. 我在参加Docker初学者课程时遇到了同样的问题。 I solved the issue by doing a docker login before the docker push call. 我通过在docker push调用之前进行docker login解决了该问题。


#5楼

Important also to note is that when you tag your image, you tag it using the Namespace and then your repository / mydevrepo . 还需要注意的重要一点是,标记图像时,请先使用命名空间 (然后是存储库/ mydevrepo)对其进行标记 This confused me when following the Docker docs. 在关注Docker文档时,这让我感到困惑。 After that I used: 之后,我使用了:

docker login

And then I pushed my Image using the 'tagged name' . 然后我使用'tagged name'推送了我的图片。

docker push {namespace}/mydevrepo

#6楼

如果在docker login后仍然失败,请确保首先尝试创建要推送到的存储库。

猜你喜欢

转载自blog.csdn.net/p15097962069/article/details/107666425