Home > front end >  Docker push to private registry error [denied: requested access to the resource is denied]
Docker push to private registry error [denied: requested access to the resource is denied]

Time:10-24

I login like this:

PS C:\workl> docker login some-registry.io -u [email protected] -p somePasswrod 
WARNING! Using --password via the CLI is insecure. Use --password-stdin.
Login Succeeded
                                                                                                                                                                

When I run docker images I get this

CREATED = user/custom-images
tag 1 
imageID=34e982156f

I then try to push

docker push user/custom-image:1
The push refers to repository [docker.io/library/custom-image]
50c2af6d2450: Preparing
862d28b9e0d9: Preparing 
...
...
878dab86cf0f: Waiting
denied: requested access to the resource is denied
                                                                                                                                                                                                                                                                                               

Why? I am adding a tag and have seen others online similar to this but don't seem to be able to find a solution. I can pull just fine.

CodePudding user response:

As @altvits said,

If you want to push to some-registry.io you need to tag it like docker image tag image:tag some-registry.io/path/image:tag and push it as docker image push some-registry.io/path/image:tag.

Without tagging the push will attempt to push to the default location which in your case is docker.io

CodePudding user response:

you need to follow this steps to push to a container :

1/ create a repository inside docker hub https://hub.docker.com/repositories :

just click on create a new repository.

2/ tagging your local image:
docker tag /

the repo_name is the one you created in step 1

3/ commit the image :

docker commit <existing-container> <hub-user>/<repo-name>

4/ and finnaly push it :

docker push <hub-user>/<repo-name>
  • Related