0

I have created a new docker image with a

# docker build -t my-phpapache:7.4 .

Now, when I try to make

# docker image push

I'm logged in to a Docker hub in a browser. I see the errors:

$ docker image push --all-tags docker.io/library/my-phpapache
The push refers to repository [docker.io/library/my-phpapache]
f04ed43187a6: Preparing 
0ff1b9aaef0c: Preparing 
c18803e039cd: Preparing 
a735fdc00d49: Preparing 
de7c912f2726: Preparing 
e835c99ddfc4: Waiting 
1f55d9e78afa: Waiting 
5aefa6797d83: Waiting 
70af74272d2e: Waiting 
58e3131f3b01: Waiting 
a1bae98a9430: Waiting 
752cff7a1101: Waiting 
be3607e92e69: Waiting 
2ffebc0bdeea: Waiting 
4c94b016478b: Waiting 
a9019c838a13: Waiting 
015643a98838: Waiting 
f2c64a370cec: Waiting 
d5b8874e6c41: Waiting 
9eb82f04c782: Waiting 
denied: requested access to the resource is denied
New contributor
Taras is a new contributor to this site. Take care in asking for clarification, commenting, and answering. Check out our Code of Conduct.
4
  • 1
    You need to log in through the CLI to achieve a push. Please look at this Link. May 12 at 14:01
  • Thank you, Kristian Kanchev, I've tried your instructions. Logged out, generated Access token with a full access. I've logged in with it. I've repeated docker image push --all-tags docker.io/library/my-phpapache and I see the same error message: "denied: requested access to the resource is denied"
    – Taras
    May 12 at 14:11
  • Can you try to be more specific with your push, maybe have a look at this? May 12 at 14:44
  • $ docker logout Removing login credentials for index.docker.io/v1 $ $ docker login -u shtaras Password: Login Succeeded $ $ docker image push --all-tags docker.io/library/my-phpapache The push refers to repository [docker.io/library/my-phpapache] f04ed43187a6: Preparing ... 9eb82f04c782: Waiting denied: requested access to the resource is denied $
    – Taras
    May 12 at 15:33

1 Answer 1

0

To push, you need write access to the destination repository. With Docker Hub, those repositories must be under your userid, or in an organization where you have write access. The default path you see added, docker.io/library, is used by official images, which makes pulling official images easier. But since you aren't the author of docker official images, that won't work for pushing.

That means you need to:

docker build -t your-user/your-image:v1 .
docker push your-user/your-image:v1

Where your-user is the same user you used when running docker login.

Your Answer

Taras is a new contributor. Be nice, and check out our Code of Conduct.

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.