Docker for Windows not pulling images from private v2 api registry

Expected behavior

docker pull registry:5000/compliance

should pull an image from a local private registry.

Actual behavior

$ docker pull registry:5000/compliance
Using default tag: latest
Pulling repository registry:5000/compliance
Error while pulling image: Get http://registry:5000/v1/repositories/compliance/images: dial tcp: lookup registry on 192.168.65.3:53: server misbehaving

However when I probe the registry with curl then the image is there:

$ curl -s -X GET http://registry:5000/v2/compliance/tags/list
{"name":"compliance","tags":["master","STAGING","PROD","latest","DEV"]}

Information

The registry is a standard registry:2 image (8ff6a4aae657) container running on an Ubuntu box. Pulling the images from other Ubuntu machines works fine. It seems to me like Docker for Windows is only trying the V1 API and not probing the V2 api. Is there any way to configure Docker for Windows to use the V2 API?

I initially had problems specifying that it’s an --insecure-registry but I found it under the Docker Daemon settings and the error message changed after that so I don’t think that is the problem (most notably the URL in the error message changed from https:// to http://).

I have uploaded a Diagnostic: 8F5F7DC1-760A-48DD-A27D-99C61DA9A8C8/2016-07-22_15-43-19

Your problem is identical to mine. I haven’t solved the issue yet, but I have determined that the issue is related to the DNS lookup of your private registry. A workaround would be to use the FQDN for your registry. I tried adding an entry to the hosts file, but that failed.

Here is my question: Docker for Windows Pull from Private Repository Fails Without FQDN

@jbulcher Thank you for linking to your issue. My setup also works great on Linux. I will try your FQDN suggestion. Please let me know if you find any other solutions.

I’ve found it possible to force the use of v2 by adding “disable-legacy-registry” : true to my Docker Daemon (config file). See https://docs.docker.com/engine/reference/commandline/dockerd/#/daemon-configuration-file
for all options.

However this did not solve the problem, docker still thinks the server is misbehaving. As with the others, under Linux or docker-machine it works fine.

[edit] After adding the IP (NOT the DNS-resolved name) to “insecure-registries” in the same config file, and pulling by that IP, it ‘works’. So @jbulcher is right, it’s a DNS issue as well. [/edit]