I am not able to push image to my repository in DockerHub
First I try done this without creating in the DockerHub Repository and later I try with creating one(shlomidahan), I try manny suggestions from forum not helped login…
In both i am getting famous error i saw here: denied: requested access to the resource is denied
shlomi_d100_gmail_com@app-ws:~$ docker image build -t shlomidahan/hello-world:v1.0 .
Sending build context to Docker daemon 46.59kB
Step 1/7 : FROM alpine:latest
—> a187dde48cd2
Step 2/7 : RUN apk update && apk add nodejs
—> Running in fd0b3dc09878
.
.
shlomi_d100_gmail_com@app-ws:~$ docker image ls
REPOSITORY TAG IMAGE ID CREATED SIZE
shlomidahan/hello-world v1.0 5098a02dd07a 51 seconds ago 39MB
alpine latest a187dde48cd2 3 weeks ago 5.6MB
shlomi_d100_gmail_com@app-ws:~$ docker push shlomidahan/hello-world:v1.0
The push refers to repository [docker.io/shlomidahan/hello-world]
676075e96975: Preparing
1e8f7dc72430: Preparing
7c139ca695eb: Preparing
beee9f30bc1f: Preparing denied: requested access to the resource is denied
shlomi_d100_gmail_com@app-ws:~$
shlomi_d100_gmail_com@app-ws:~$ docker login
Authenticating with existing credentials…
WARNING! Your password will be stored unencrypted in /home/shlomi_d100_gmail_com/.docker/config.json.
Configure a credential helper to remove this warning. See
Login Succeeded
shlomi_d100_gmail_com@app-ws:~$ docker push shlomidahan/hello-world:v1.0
The push refers to repository [docker.io/shlomidahan/hello-world]
676075e96975: Preparing
1e8f7dc72430: Preparing
7c139ca695eb: Preparing
beee9f30bc1f: Preparing
denied: requested access to the resource is denied
shlomi_d100_gmail_com@app-ws:~$
– I did logout and login again but still:
shlomi_d100_gmail_com@app-ws:~$ docker login
Login with your Docker ID to push and pull images from Docker Hub. If you don’t have a Docker ID, head over to https://hub.docker.com to create one.
Username: shlomid100
Password:
WARNING! Your password will be stored unencrypted in /home/shlomi_d100_gmail_com/.docker/config.json.
Configure a credential helper to remove this warning. See docker login | Docker Docs
Login Succeeded
shlomi_d100_gmail_com@app-ws:~$ docker push shlomidahan/hello-world:v1.0
The push refers to repository [docker.io/shlomidahan/hello-world]
676075e96975: Preparing
1e8f7dc72430: Preparing
7c139ca695eb: Preparing
beee9f30bc1f: Preparing
denied: requested access to the resource is denied
shlomi_d100_gmail_com@app-ws:~$
‘docker login’ Succeeded, but this didn’t help.
I am trying from my home computer, using an account created from work.
I noticed I cannot add my private email to the account.
Actually, I had added my home email… (different accounts?).
Anyway, now I generated a token, and get a different error:
fortune> docker push marcsf/fortune
Using default tag: latest
The push refers to repository [docker.io/marcsf/fortune]
An image does not exist locally with the tag: marcsf/fortune
fortune> docker pull marcsf/fortune
Using default tag: latest
Error response from daemon: manifest for marcsf/fortune:latest not found: manifest unknown: manifest unknown
The build however succeeded…
fortune> docker build -t marcfs/fortune .
Sending build context to Docker daemon 4.096kB
…
Successfully built c30b02bd45f3
Successfully tagged marcfs/fortune:latest
Update and reboot. Back to the first error:
fortune> docker push marcfs/fortune:latest
The push refers to repository [docker.io/marcfs/fortune]
a5b2854347d7: Preparing
f58de555d8e7: Preparing
9f54eef41275: Preparing
denied: requested access to the resource is denied
OK… It’s what I guessed: this works from my work box…
So, the repositories under my account are somehow restricted…
Do I need to create a new Id?
But now, I cannot even pull it from my home box!
Login Succeeded
fortune> docker pull marcfs/fortune
Using default tag: latest
Error response from daemon: pull access denied for marcfs/fortune, repository does not exist or may require ‘docker login’: denied: requested access to the resource is denied
I was facing a similar issue and struggled to find the correct resolution for half a week but eventually found the solution:
You need to make sure to logout and use docker login command just before the push command. Moreover, I reckon the trick is that image name and tag needs to be same or we need to manually tag the image after creation using tag command with username /image-name:tag-name
Let’s assume you are user_x, and have a repo called user_x/repo_y, then you will need to tag the image as user_x/repo_y:{arbitrary tag name}, where {arbitrary tag name} can be whatever wanted.