denied: requested access to the resource is denied

2019-01-12 16:41发布

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

enter image description here

Could anyone give me some hint towards this problem ? Any help would appreciated.

Note: I have successfully login into docker

30条回答
够拽才男人
2楼-- · 2019-01-12 17:14

Use Below commands:

$ docker login
<enter user name and password for Docker Hub Repository>

$ docker tag first-image {docker-hub-username}/{default-repo-folder-name}:first-image

$ docker push {docker-hub-username}/{default-repo-folder-name}:first-image

e.g. I have public repository like manjeet86/docker-repo so commands would be:

$ docker tag first-image manjeet86/docker-repo:first-image

$ docker push manjeet86/docker-repo:first-image

Just see : instead of / that was the trick. It works for me. I do not know if it lets you tag with / as well in place of : but that may be for some other purpose.

https://docs.docker.com/engine/reference/commandline/tag/#examples

查看更多
来,给爷笑一个
3楼-- · 2019-01-12 17:17

Docker also has a limit on the number of private repositories you can have. If you're creating a private repository by pushing from your local machine, it will create the repository but nothing further can be pushed to it or pulled from it, and you'll get the "requested access to the resource is denied" error.

查看更多
Juvenile、少年°
4楼-- · 2019-01-12 17:17

In my case I was pushing to an organization where I am in a team that has admin permissions to the repository.

so my push command was: docker push org-name/image-name

I could push successfully to username/image-name but not to the organization. I triple checked the permissions. Nothing worked.

The solution was to delete the repo from docker hub and push again fresh using: docker push org-name/image-name

For what its worth, I think the repo was originally pushed before the account was converted to an organization.

查看更多
forever°为你锁心
5楼-- · 2019-01-12 17:21

Try sign out of "Docker for Windows" application and sign out of https://hub.docker.com/ site and after perform "docker login" and "docker push". It helped for me.

查看更多
疯言疯语
6楼-- · 2019-01-12 17:21

This answer is as much for my future self as for anyone else. I have encountered this exact problem when I am logged in correctly, but I am attempting to push to a private repo when my number of private repos is greater than or equal to the limit allowed by my plan.

I'm not exactly sure how I was able to create too many private repos, but if my plan includes 5 private repos, and somehow I have 6, then this is the error that I will receive:

denied: requested access to the resource is denied

In my case it's possible that I ended up with too many private repositories because I have my default visibility set to private:

Default Visibility

This is where you determine how many private repos you can have:

Billing Plans

Once I made the problematic repo public, the issue became apparent:

Make Repository Private 5 of 5

查看更多
戒情不戒烟
7楼-- · 2019-01-12 17:23

I was with this issue too, I tested the solutions in here present but to no avail, I was properly logged in, at least according to the output of docker login but still I could not push the image. What finally worked was simply to do:

docker logout

And then docker login again, it was that trivial. I'm not sure what happened but forcing the re-login worked.

查看更多
登录 后发表回答