How do I push an image to my NON-public repo in dockerhub

1k views Asked by At

How do I push to a non-public repository on dockerhub?

Suppose the account is called “myaccount” and the (non-public) repo is called “myrepo”. In the repo page it says, “Pull this repository: docker pull myaccount/myrepo”.

E.g., suppose I have an image called “myrepo/myimage”. I have logged into my account (sudo docker login), and tried,

sudo docker push docker.io/myrepo/myimage
sudo docker push myrepo/myimage
sudo docker push myaccout:myrepo/myimage
sudo docker push myaccount/myrepo:myrepo/myimage
sudo docker push myaccount/myrepo:myimage

etc.

None of these work. I get errors like "Invalid repository name", or it succeeds but says, "Do you really want to push to public registry?" - and I do not - I want to push it to my non-public dockerhub repo ("myaccount/myrepo").

1

There are 1 answers

4
Sabin On

Please tag your image first as myaccount/myrepo:<tag-name> locally using
docker tag <your-local-image> myaccount/myrepo:<tag-name> and then try
docker push myaccount/myrepo:<tag-name>
Note Give a valid name for <tag-name> like v1, v2, etc.