Docker image push denied: requested access to the resource is denied

Hi,

I am having issue unable to push image to docker.io
I searched several solutions but failed:

Here is how I push image:

  1. Commit the container
    docker container commit 622ba58fe314 khoa/npm-app:v1

  2. Log in Docker:
    docker login -u khoana85

  3. tag image to docker.io
    docker tag khoa/npm-app:v1 khoana85/learningdocker/npm-app:v1

  4. recheck
    docker image ls -a
    REPOSITORY TAG IMAGE ID CREATED SIZE
    khoa/npm-app v1 571a76a91a9c 2 minutes ago 1.1GB
    khoana85/learningdocker/npm-app v1 571a76a91a9c 2 minutes ago 1.1GB

  5. push image with new tag but failed

docker image push -a khoana85/learningdocker/npm-app
The push refers to repository [docker.io/khoana85/learningdocker/npm-app]
221d3021d8cb: Preparing
ef80579b0296: Preparing
2f6f74fe2429: Preparing
146e03f15953: Preparing
5f70bf18a086: Preparing
f03c7a8d7c84: Waiting
ec35e25810ef: Waiting
3e8246801f04: Waiting

denied: requested access to the resource is denied

Hope someone could help me.
Thank you

You can not have created such a repo on Dockerhub, as there is no option to create subgroups

It will work like this:

docker image push khoa/npm-app:v1

or

docker image push -a khoa/npm-app

Thanks @meyay

I have tried your suggestion but still same error

PS C:\WINDOWS\system32> docker login -u khoana85
Password:
Login Succeeded
PS C:\WINDOWS\system32> docker image push khoa/npm-app:v1
The push refers to repository [docker.io/khoa/npm-app]
221d3021d8cb: Preparing
ef80579b0296: Preparing
2f6f74fe2429: Preparing
146e03f15953: Preparing
5f70bf18a086: Preparing
f03c7a8d7c84: Waiting
ec35e25810ef: Waiting
3e8246801f04: Waiting
a3fcf15233da: Waiting
f676df9e9c4b: Waiting
175ee975301d: Waiting
975e2af2907a: Waiting
99b0eedc56e5: Waiting
b339d4693fe4: Waiting
228797771a45: Waiting
865a36a23890: Waiting
d282489b701d: Waiting
06c17841fde4: Waiting
0a9327a82409: Waiting
b4975523baf2: Waiting
e0ba20d9d8fa: Waiting
1bc762a0c361: Waiting
5dfabd49bf4a: Waiting
5256519e516b: Waiting
9df83f62cdd6: Waiting
1c6350ec6eff: Waiting
92dd699ff75e: Waiting
7051c88224a5: Waiting
9a0e2a6fdaf6: Waiting
527d94242b4c: Waiting
d0f2ed043155: Waiting
88202a7158cb: Waiting
f0e7c4343948: Waiting
1387079e86ad: Waiting
denied: requested access to the resource is denied

Hi,

On docker hub, my repository is “khoana85/learningdocker”

I try another naming but still in vain:

PS C:\WINDOWS\system32> docker image ls -a
REPOSITORY TAG IMAGE ID CREATED SIZE
khoana85/learningdocker/npm-app v1 46f65e4b11af About a minute ago 1.1GB
npm-app v1 46f65e4b11af About a minute ago 1.1GB

PS C:\WINDOWS\system32> docker image push -a khoana85/learningdocker/npm-app
The push refers to repository [docker.io/khoana85/learningdocker/npm-app]
221d3021d8cb: Preparing

f0e7c4343948: Waiting
1387079e86ad: Waiting
denied: requested access to the resource is denied

Hi

I have pushed image successfully using this:

=============================================

PS C:\WINDOWS\system32> docker container commit 622ba58fe314 npm-app
sha256:d852ccb62c1b63a47964188b50c0be49a4956e120ba8c724c29d079ff2d437ae
PS C:\WINDOWS\system32> docker image ls -a
REPOSITORY TAG IMAGE ID CREATED SIZE
npm-app latest d852ccb62c1b 4 seconds ago 1.1GB

PS C:\WINDOWS\system32> docker image tag npm-app khoana85/learningdocker:npm-app
PS C:\WINDOWS\system32> docker image ls -a
REPOSITORY TAG IMAGE ID CREATED SIZE
khoana85/learningdocker npm-app d852ccb62c1b About a minute ago 1.1GB
npm-app latest d852ccb62c1b About a minute ago 1.1GB

PS C:\WINDOWS\system32> docker image push khoana85/learningdocker:npm-app
The push refers to repository [docker.io/khoana85/learningdocker]
221d3021d8cb: Pushed
ef80579b0296: Pushed
2f6f74fe2429: Pushed
146e03f15953: Pushed
5f70bf18a086: Pushed
f03c7a8d7c84: Pushed
ec35e25810ef: Pushed
3e8246801f04: Pushed
a3fcf15233da: Pushed
f676df9e9c4b: Pushed
175ee975301d: Pushed
975e2af2907a: Pushed
99b0eedc56e5: Pushed
b339d4693fe4: Pushed
228797771a45: Pushed
865a36a23890: Pushed
d282489b701d: Pushed
06c17841fde4: Pushed
0a9327a82409: Pushed
b4975523baf2: Pushed
e0ba20d9d8fa: Pushed
1bc762a0c361: Pushed
5dfabd49bf4a: Pushed
5256519e516b: Pushed
9df83f62cdd6: Pushed
1c6350ec6eff: Pushed
92dd699ff75e: Pushed
7051c88224a5: Pushed
9a0e2a6fdaf6: Pushed
527d94242b4c: Pushed
d0f2ed043155: Pushed
88202a7158cb: Pushed
f0e7c4343948: Pushed
1387079e86ad: Pushed
npm-app: digest: sha256:77ee8d0943df2a20830126b5576ae9eed5187da1dad9b5f35405ffd61be9d493 size: 7431

My bad, I missed that you created the image with a tag, that does not match your username.
Glad you already discovered it yourself.