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.

Billboard image

Deploy and scale your apps on AWS and GCP with a world class developer experience

Coherence makes it easy to set up and maintain cloud infrastructure. Harness the extensibility, compliance and cost efficiency of the cloud.

Learn more

Top comments (0)

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more