Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

like image 574
Keyur Shah Avatar asked Feb 01 '17 16:02

Keyur Shah


People also ask

Can't push image denied requested access to the resource is denied Jenkins?

1st: you have to make sure dockerhub credentials on jenkins. 2nd: You have creat a job with pipeline project 3rd: Then you have to push your project with jenkinsfile. 4th: now you can build jenkins.

How do I log into Docker Hub from command line?

To run the docker login command non-interactively, you can set the --password-stdin flag to provide a password through STDIN . Using STDIN prevents the password from ending up in the shell's history, or log-files.


2 Answers

You may need to switch your docker repo to private before docker push.

Thanks to the answer provided by Dean Wu and this comment by ses, before pushing, remember to log out, then log in from the command line to your docker hub account

# you may need log out first `docker logout` ref. https://stackoverflow.com/a/53835882/248616 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 
like image 76
Webert Lima Avatar answered Oct 01 '22 10:10

Webert Lima


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

like image 38
Dean Wu Avatar answered Oct 01 '22 12:10

Dean Wu