Docker: Issue with pulling from a private registry

2019-04-28 19:55发布

问题:

I just started learning docker.

I have a private registry running on one server(server1), and can pull a test image from it on server1 by typing the following:

docker pull 127.0.0.1:5000/test

However, when I type the above command from another server, I get the error message below:

Error: Invalid Registry endpoint: Get http://127.0.0.1:5000/v1/_ping: dial tcp 127.0.0.1:5000: connection refused

Am I missing something in configuration?

Any help is appreciated.

Thanks!

回答1:

The IP 127.0.0.1 refers always to the local machine. So when you call 'docker pull 127.0.0.1:5000/test' from another machine, you must use the real IP of the server, not 127.0.0.1.

Maybe try to ping the Server first by calling http://XXXXXXX:5000/v1/_ping from the other machine to make sure it is available and you use the correct IP.



回答2:

Docker 1.3 added '--insecure-registry' parameter which allows you to pull from a remote private registry. Refer this: Setting up a remote private Docker registry



标签: docker