Environment:
- OS: debian 8.0.0-amd64, ubuntu-15.04, 16.04
- Docker: 1.x.x
Procedure:
I changed /etc/default/docker
to add a private docker registry, then I restarted docker service and finally tried to pull some image.
$ cat /etc/default/docker
DOCKER_OPTS="--insecure-registry mydocker-registry.net:5000"
$ service docker restart
$ docker pull mydocker-registry.net:5000/testdb
FATA[0000] Error: v1 ping attempt failed with error: Get https://mydocker-
registry.net:5000/v1/_ping: dial tcp: lookup mydocker-registry.net: no
such host. If this private registry supports only HTTP or HTTPS with an
unknown CA certificate, please add `--insecure-registry mydocker-
registry.net: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/mydocker-
registry.net:5000/ca.crt
A ps
output shows nothing about DOCKER_OPTS environment var.
$ ps auxwww|grep docker
root 6919 0.0 0.1 331076 19984 ? Ssl 10:14 0:00 /usr/bin/docker -d -H fd://
Question:
According to docker documentation the way to use a private registry is through DOCKER_OPTS in /etc/default/docker
. Why, after doing that, it does not take effect in this environment?
Notes:
- The private registry hostname is correctly resolved by the DNS.
dial tcp: lookup mydocker-registry.net: no such host
/etc/default/docker
?--dns
option to yourDOCKER_OPTS
? (as in stackoverflow.com/q/29607761/6309)