docker push error "denied: requested access to the resource is denied"

I too had the same issue, but after trying some combinations this worked.

Whenever you push - that refers to docker.io/ followed by registry path.

In my case my username is rushmith and I created a sample repository called docker under rushmith.

My link is : "hub.docker.com/r/rushmith/docker/"

Now I created a tag to my image that I want to push as: rushmith/docker

And It worked successfully.

$ docker login -u rushmith

(Give the password then type as below)

$ docker push rushmith/docker:latest

Output:

The push refers to a repository [docker.io/rushmith/docker]
7fbb0e1e64cb: Pushed
33f1a94ed7fc: Pushed 
b27287a6dbce: Pushed 
47c2386f248c: Pushed 
2be95f0d8a0c: Pushed 
2df9b8def18a: Pushed 
latest: digest: 
sha256:4d749d86b4a2d9304a50df474f6236140dc2d169b9aabc354cdbc6ac107390f2 size: 1569

  1. First login by typing sudo docker login in the terminal. Enter username and password

  2. Visit your docker account and create a new repository. In my case I created a repository crabigator1900/dockerhub

  3. Say you have a docker image with repository name:crabigator/django and tag:latest.

In that case you will need to tag this image with a label of your wish. I decided to tag it with the label:myfirstimagepush. You tag the image by typing the command

sudo docker tag crabigator/django:latest crabigator1900/dockerhub:firstimagepush

  1. Finally push the image to your repo using the command

sudo docker push crabigator1900/dockerhub:firstimagepush

That's all there is to it.


The solution is simply to change the way of logging in at step (1).

docker login -u janedoe -p <password>

Everything else can stay the way described above. The image was successfully pushed to Docker Hub!