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").
Please tag your image first as
myaccount/myrepo:<tag-name>
locally usingdocker tag <your-local-image> myaccount/myrepo:<tag-name>
and then trydocker push myaccount/myrepo:<tag-name>
Note Give a valid name for <tag-name> like v1, v2, etc.