Unable to pull private repo in docker

2.1k views Asked by At

I created an image for my application and uploaded it as private repository in registry.hub.docker.

Now I every time I try to pull it, I get the following error

FATA[0012] Repository not found  

I have successfully authenticated myself with docker using docker login command

Command I ran

## docker login
docker login
Username (werain): werain
WARNING: login credentials saved in /Users/werain/.dockercfg.
Login Succeeded

## docker pull
docker pull werain/digitdem

Any Clue?

2

There are 2 answers

1
Nathaniel Waisbrot On

Use the full image name, including the tag, when pushing and pulling:

docker push werain/digitdem:latest
docker pull werain/digitdem:latest

Docker generally assumes you mean latest when you don't specify, but if you want to use your own tag or if you didn't push the same tag as you're trying to pull, then omitting the tag won't work.

0
Javeed Shakeel On

Add .netrc file to the dockerfile will pass credentials inside the docker containers and helps to pull more than one private repositories to build dependencies

#vim .netrc
  machine github.com
      login < your github token >

Add those 2 lines and pass your github token

Then copy the .netrc file to the container by including this line

COPY .netrc /root/