Dan O'Leary
Dan O'Leary

Reputation: 2822

How can I pull a Docker image from a private Docker Hub repo remotely?

I have several images in Docker Hub private repositories, and I need to pull these on remote machines using the Docker remote Rest API. Is there a way of authenticating remotely?

These are the calls I'd like to make remotely:

docker login
docker pull myrepo/myimage

Upvotes: 46

Views: 127750

Answers (3)

Neela
Neela

Reputation: 107

I could fix the same issue only when I made the repo public. Make sure the repository is public then this is the set of instructions I followed in command line: Once logout from docker hub and login again.

1- docker logout

2- docker login --username=YOURUSERNAME Enter password when asked

3- docker pull "repositoryName"/"imageName"[:tag]

if "tag" is not included the default value will be "latest". Then check the images by docker images command to check if its been pulled.

Upvotes: -1

user11823934
user11823934

Reputation: 1

docker image pull 127.0.0.1:5000 /jenkins:latest

The above ip is your private machine's ip and 5000 is your mapping port /jenkins:latest is your image name which is present in your private registry, you can check it @ localhost:5000/v2/_catalog

Upvotes: -5

Carlos Villalba
Carlos Villalba

Reputation: 939

Yes there is a way, you only need to specify the remote host

docker login myrepo.com

Then you can access to your images

docker pull myrepo.com/myimage

and you can specify a tag as well

docker pull myrepo.com/myimage:mytag

Hope this works for you.

Upvotes: 82

Related Questions