How to push a docker image to a private repository

Eugene Goldberg picture Eugene Goldberg · Feb 5, 2015 · Viewed 424.6k times · Source

I have a docker image tagged as me/my-image, and I have a private repo on the dockerhub named me-private.
When I push my me/my-image, I end up always hitting the public repo.

What is the exact syntax to specifically push my image to my private repo?

Answer

Abdullah Jibaly picture Abdullah Jibaly · Feb 5, 2015

You need to tag your image correctly first with your registryhost:

docker tag [OPTIONS] IMAGE[:TAG] [REGISTRYHOST/][USERNAME/]NAME[:TAG]

Then docker push using that same tag.

docker push NAME[:TAG]

Example:

docker tag 518a41981a6a myRegistry.com/myImage
docker push myRegistry.com/myImage