DEV Community

Matthew Dailey
Matthew Dailey

Posted on

1

Adding Docker image to Docker Hub private repository

I've learned something as straightforward as adding a Docker image to a repository can be somewhat frustrating. When I say private repository I mean a private repository hosted on Docker Hub.

Here are the steps I had to take to successfully push a Docker image:

  1. If you recently created a private repo, log out of Docker and then login back in by running docker logout and docker login commands. The reason behind this is to make sure Docker is aware that the private repo exists.
  2. This is very important. The Docker image has to be named exactly the same as the private repo. If it is not named the same, you will get a requested access to the resource is denied error. To change the Docker image name, run 'docker tag [current image name] [dockerhub username/private repo name:tag]. You can add whatever you want for the tag, I added '1.0'.
  3. Now with the Docker image having the correct name, you can add it to the private repository. Run docker push [username/private repo name:tag]. For example docker push johnsmith/demorepo:1.0.

You're done.

Heroku

Built for developers, by developers.

Whether you're building a simple prototype or a business-critical product, Heroku's fully-managed platform gives you the simplest path to delivering apps quickly β€” using the tools and languages you already love!

Learn More

Top comments (0)

πŸ‘‹ Kindness is contagious

Engage with a wealth of insights in this thoughtful article, valued within the supportive DEV Community. Coders of every background are welcome to join in and add to our collective wisdom.

A sincere "thank you" often brightens someone’s day. Share your gratitude in the comments below!

On DEV, the act of sharing knowledge eases our journey and fortifies our community ties. Found value in this? A quick thank you to the author can make a significant impact.

Okay