Docker Community Forums

Share and learn in the Docker community.

private_registry:Network Error (dns_unresolved_hostname)

(Lalatdas) #1

I have a very basic question, Is it mandatory to have dns resolution to happen for the node which is hosting a private docker registry in an subnet? Can’t the name resolution happen via host-name with an appropriate entry in /etc/hosts file?

I am trying to set up an insecure private registry using daemon.json file as directed in docker documentation.
The environment is as follows:

OS Version/build : Ubuntu 16.04 LTS
Docker App version: 17.09.0-ce

Following commands are executed in order:
docker run -d -p 9011:5000 --restart=always --name airgap_registry registry:2

The docker ps command out put shows an private registry started garcefully

$ docker ps
CONTAINER ID        IMAGE               COMMAND                  CREATED             STATUS              PORTS                    NAMES
6549fba7d0c7        registry:2          "/ /e..."   11 minutes ago      Up 11 minutes>5000/tcp   airgap_registry

Created an entry in for insecure registry in /etc/docker/daemon.json file as follows:

“insecure-registries” : [“das-All-Series:9011”]

The /etc/hosts file has an entry for hostname “das-All-Series”

service docker restart

(it is restarted to pick up changes in daemon.json file)

Now pushing image to private registry from the machine wherein private registry server is run.

docker tag hello-world das-All-Series:9011/a-new-hello-world
docker push das-All-Series:9011/a-new-hello-world

It is throwing DNS resolution failed.

$ docker push das-All-Series:9011/a-new-hello-world
The push refers to a repository [das-All-Series:9011/hello-world-insecure-pushed-from-5]
3a36971a9f14: Preparing
error parsing HTTP 404 response body: invalid character ‘<’ looking for beginning of value: “\r\nNetwork Error\r\n\r\n\r\n<FONT face=“Helvetica”>\r\n

\r\n<TABLE border=0 cellPadding=1 width=“80%”>\r\n\r\n<FONT face=“Helvetica”>\r\nNetwork Error (dns_unresolved_hostname)\r\n
\r\n\r\n\r\n\r\n<FONT face=“Helvetica”>\r\nYour requested host “das-all-series” could not be resolved by DNS.\r\n\r\n\r\n\r\n<FONT face=“Helvetica”>\r\n\r\n\r\n\r\n\r\n<FONT face=“Helvetica” SIZE=2>\r\n
\r\nFor assistance, contact your network support team.\r\n\r\n\r\n\r\n

Subsequently tried creating an entry in insecure registry with directly IP address and creatiing an image with IP address as server, but that didn’t work as well.

Kindly guide if I am missing something here.