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:00

Not sure what happened to docker hub, but none of the solutions posted worked for me. Here is the work-around that ended up working for me as of Jan-2018:

  1. Go to hub.docker.com and change your repository to private
  2. In your shell do:

docker images

REPOSITORY TAG IMAGE ID CREATED SIZE verse_gapminder_gsl latest 023ab91c6291 3 minutes ago 1.975 GB verse_gapminder latest bb38976d03cf 13 minutes ago 1.955 GB rocker/verse latest 0168d115f220 3 days ago 1.954 GB

docker tag bb38976d03cf dockhubusername/verse_gapminder:mytag

docker login docker.io

docker push dockhubusername/verse_gapminder:mytag

  1. Go back to docker hub and change repo back to public. That worked for me.
查看更多
欢心
3楼-- · 2019-01-12 17:01

Another (pretty smart) reason for this: you're out of private repos with your plan.

查看更多
【Aperson】
4楼-- · 2019-01-12 17:01

My answer is related to Azure DevOps similar issues I had with the following common pipeline (it is more specific but it might help somebody save time):

  1. Get sources from github
  2. Build docker image
  3. Push docker image to dockerhub

The error I received at push denied: requested access to the resource is denied sent me here.

Please be careful of the variable $(Build.Repository.Name) included in your image name. It is by default the name of the repository from github, but for your push to work it should be dockerhub_account_username/your_dockerhub_repository_name.

Replace $(Build.Repository.Name) with dockerhub_account_username/your_dockerhub_repository_name in your image name field for both build and push steps.

This is needed by the dockerhub api to know where to push the image.

查看更多
够拽才男人
5楼-- · 2019-01-12 17:02

I got the same issue while taking the docker beginner Course. I solved the issue by doing adocker login before the docker push call.

查看更多
我命由我不由天
6楼-- · 2019-01-12 17:02

If you face this issue while using Azure Container Registry, you can solve it by logging in to your registry first.

docker login yourregistry.azurecr.io

And then tag your image to match the host name of your registry.

docker image tag yourimagename:[version] yourregistry.azurecr.io/yourimagename:[version]

And then finally push it.

docker push yourregistry.azurecr.io/yourimagename:[version]
查看更多
smile是对你的礼貌
7楼-- · 2019-01-12 17:04

OS: Ubuntu16.04

Reason: I deleted the client config file(~/.docker/config.json)

Solution:

  • Restart docker.
    service docker restart.
  • It needs to input Login info, then generates config file automatically.
    docker login --username=yourdockerhubername --email=youremail@company.com
查看更多
登录 后发表回答