Explore Courses Blog Tutorials Interview Questions
0 votes
in DevOps and Agile by (2.3k points)

I have created a custom image that i wish to upload onto my private repository on DockerHub. I tagged it as "project/custom-image-1" . Whenever i try to push this particular custom image onto my private registry , it gets pushed to the public repository and not the private one.

Can anyone help me out with this? what is the standard way to do this?


1 Answer

+1 vote
by (6.9k points)
selected by
Best answer

So there is a standard way to do this, you can first tag your image with the URI of your private repository, follow the below syntax :


Then once you are done tagging the image you want to push, just use the docker push command, like how it's given below : 

docker push NAME[:TAG]
If the above doesn't work out, try logging into dockerhub account first
docker login --username username
Then tag your image with the correct repository
docker tag my-image username/my-repo
And then finally push it 
docker push username/my-repo

Also If you want to become more adept with docker you can check this Docker training course . You will be trained by industry professionals who have years of experience in docker. Or you can check out this Docker Tutorial to get to know more about how to use docker.

Browse Categories