DEV Community

Matthew Dailey
Matthew Dailey

Posted on


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.

Top comments (0)

An Animated Guide to Node.js Event Loop

Node.js doesn’t stop from running other operations because of Libuv, a C++ library responsible for the event loop and asynchronously handling tasks such as network requests, DNS resolution, file system operations, data encryption, etc.

What happens under the hood when Node.js works on tasks such as database queries? We will explore it by following this piece of code step by step.