1

I have set up the registry server as below:

docker run -d --name p_registry -e SETTINGS_FLAVOUR=local -e STORAGE_PATH=/reg_storage -v /data/private-registry/storage:/reg_storage -p 5000:5000 registry

So, now I can push to this registry locally using

docker push localhost:5000/hello:tag1

But when I tried to push it from another machine, to this registry, it bails out:

docker push 1.2.3.4:5000/hello:tag1

Error: Invalid registry endpoint https://1.2.3.4:5000/v1/: Get https://1.2.3.4:5000/v1/_ping: EOF. If this private registry supports only HTTP or HTTPS with an unknown CA certificate, please add `--insecure-registry 1.2.3.4:5000` to the daemon's arguments. In the case of HTTPS, if you have access to the registry's CA certificate, no need for the flag; simply place the CA certificate at /etc/docker/certs.d/1.2.3.4:5000/ca.crt

Now, after that I tried various other options:

Edit /etc/sysconfig/docker
other_args=--insecure-registry=1.2.3.4:5000

And then restarted docker using "service docker restart". This didn't work either. Every time, I tried to push, it gave me the invalid registry endpoint.

I even tried doing as below:

vi /etc/default/docker
DOCKER_OPTS="$DOCKER_OPTS --insecure-registry=1.2.3.4:5000"

even the one above gives the endpoint error.

Can somebody help here ?

Ref: Remote access to a private docker-registry

Community
  • 1
  • 1
Jason
  • 2,246
  • 6
  • 34
  • 53

2 Answers2

1

DOCKER_OPTS="--insecure-registry 1.2.3.4:5000" should work

Vor
  • 33,215
  • 43
  • 135
  • 193
  • I think your answer could be true. The issue that I later realized were with the network itself, I was not able to telnet to 5000 on 1.2.3.4 from the machine which was pushing the image. I am going to try something tomorrow and will provide an update. – Jason Feb 11 '15 at 07:03
  • Here is the reason, why it was not working before. I was adding DOCKER_OPTS on the Docker registry server and not the deamon/client. It works fine if I update the /etc/sysconfig/docker file with other_args=--insecure-registry=1.2.3.4:5000. – Jason Feb 27 '15 at 00:11
1
sudo service docker stop
sudo docker -d --insecure-registry 1.2.3.4:5000

This worked for me . Please try it and let us know.

Pratik
  • 1,216
  • 11
  • 18
  • Error 1: I think my issue is more related to the iptables rules. Have you made any changes there ?? Error 2: Also, I am getting an EOF error: FATA[0002] Error: Invalid registry endpoint https://1.2.1.2:5000/v1/: Get https://1.2.1.2:5000/v1/_ping: EOF Error 3: After getting error 2, I added the ip to the /etc/hosts on the docker host. If I try "docker push docker:5000/test" it tries to use https and if I try "docker push docker/test", it is asking me for a username and password. Is this expected ?? – Jason Feb 23 '15 at 19:13
  • I have found out that the initial command specified...... docker run -d --name p_registry -e SETTINGS_FLAVOUR=local -e STORAGE_PATH=/reg_storage -v /data/private-registry/storage:/reg_storage -p 5000:5000 registry .......... had only -p 5000:5000(this serves as localhost) Please run using -p 1.2.3.4:5000:5000 Before doing this please restart docker with the commands which i have specified above. Also while pushing use docker push 1.2.3.4:5000/test.When you are try to use "docker push docker/test" it is asking username and password as it is trying to push image "docker/test"in the public domain – Pratik Feb 26 '15 at 06:32
  • 1
    Here is the reason, why it was not working before. I was adding DOCKER_OPTS on the Docker registry server and not the deamon/client. It works fine if I update the /etc/sysconfig/docker file with other_args=--insecure-registry=1.2.3.4:5000 and restart the docker service or when I run `sudo docker -d --insecure-registry 1.2.3.4:5000` on the docker client/daemon. – Jason Feb 27 '15 at 00:14