How to solve requested access to the resource is denied error when pushing docker images to registry?


When you want to push an docker image to harbor or other docker registries, you would get this error:

[[email protected] ~]# docker push
The push refers to repository []
5389ef4288ac: Preparing 
2edbab403b11: Preparing 
d7ae7175ca34: Preparing 
384cabecb0e8: Preparing 
d170a651c616: Preparing 
5216338b40a7: Waiting 
denied: requested access to the resource is denied


You should specify the repository name in the tag of the docker image, e.g.

Instead of this tag:

You should use this tag:

Because there is a repository in the your registry like this:

docker harbor

Other operations

You should make sure that you have logged in the harbor repo:

docker logout
docker login -u admin

Login Succeeded