How to push a docker image to a private repository
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
Just three simple steps:
docker login --username username
- prompts for password if you omit
--password
which is recommended as it doesn't store it in your command history
- prompts for password if you omit
docker tag my-image username/my-repo
docker push username/my-repo