title: How do I access a docker insecure registry from a Windows docker on Windows 10 machine?
body: <p>I have 2 machines running dockerd. One an Ubunto.18.04 box with docker version 18.06.1-ce installed, which I want to use as an insecure test registry/repository server where the only way I'll use it is to use a SSH tunnel in to port 5000.</p>
  
  <p>The other is a development workstation, a Windows 10 'pro' box which also has a local instance of docker (docker for Windows version 18.06.1-ce) running as a service on it which I am using to build test images.</p>
  
  <p>So far I can't get the Windows box to push to or pull from the Ubuntu box through the tunnel.</p>
  
  <p>Both dockerds are running. I added the insecure registries setting on the workstation ( via the docker GUI, I could not find the <code>daemon.json</code> file so assume it is in the Windows registry or a hidden location?)</p>
  
  <p>I added localhost:5000 to test for using the SSHE tunnel and <code>Dev2:5000</code> (temporary for this test opened port 5000 on the internal subnet) to test a direct connection without the tunnel, and restarted docker.</p>
  
  <p>On the registry box I followed the sample of how to use a private registry and did the below to test it. I was logged to "Dev2" as a user I added to the "docker" group that also has <code>sudo</code> privileges. I also tried as root.</p>
  
  <pre><code>Dev2:&gt; docker pull ubuntu:18.04
  # success
  
  Dev2:&gt; docker tag ubuntu:18.04 localhost:5000/testapp:00.01
  Dev2:&gt; docker push localhost:5000/testapp/00.01
  # success
  
  Dev2:&gt; docker tag ubuntu:18.04 Dev2:5000/testapp:00.02
  Dev2:&gt; docker push Dev2:5000/testapp/00.02
  # success
  
  Dev2:&gt; docker image rm ubuntu:18.04
  # success
  
  Dev2:&gt; docker image ls -a
  
  REPOSITORY               TAG                 IMAGE ID            CREATED             SIZE
  localhost:5000/testapp   00.01               ea4c82dcd15a        40 hours ago        85.8MB
  Dev2:5000/testapp        00.02               ea4c82dcd15a        40 hours ago        85.8MB
  registry                 2                   2e2f252f3c88        5 weeks ago         33.3MB
  
  
  Dev2:&gt; curl http://localhost:5000/v2/_catalog
  {"repositories":["testapp"]}
  
  Dev2:&gt;  curl http://localhost:5000/v2/testapp/tags/list
  {"name":"testapp","tags":["00.01","00.02"]}
  
  Dev2:&gt; curl http://Dev2:5000/v2/_catalog
  {"repositories":["testapp"]}
  
  Dev2:&gt; curl http://Dev2:5000/v2/testapp/tags/list
  {"name":"testapp","tags":["00.01","00.02"]}
  </code></pre>
  
  <p>At this point all seems to be fine. If I delete the images on the Dev2 docker and pull them they are extracted from the repository and re-added to the docker instance.</p>
  
  <p>Now I try to pull the images into docker on the workstation.</p>
  
  <p>I run a ssh tunnel ssh on the Windows 10 workstation ( Msys GNU version)</p>
  
  <pre><code>workstation:&gt; ssh nyc.livingwork.com -L 5000:localhost:5000 &amp;  # this runs and the tunnel workstation
  </code></pre>
  
  <p>I also try using a browser (no curl here) with URLs:</p>
  
  <p><a href="http://Dev2:5000/v2/testapp/tags/list" rel="nofollow noreferrer">http://Dev2:5000/v2/testapp/tags/list</a>
  and
  <a href="http://localhost:5000/v2/testapp/tags/list" rel="nofollow noreferrer">http://localhost:5000/v2/testapp/tags/list</a></p>
  
  <p>And I get for both:
  {"name":"testapp","tags":["00.01","00.02"]}</p>
  
  <p>So the server is accessible both direct and through tunnel.</p>
  
  <p>Now I try:</p>
  
  <pre><code>workstation:$ docker pull localhost:5000/testapp:00.01
  Error response from daemon: Get http://localhost:5000/v2/: net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers)
  
  workstation:&gt; docker pull Dev2:5000/testapp:00.02
  Error response from daemon: Get http://Dev2:5000/v2/: net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers)
  </code></pre>
  
  <p>The timeout is at least 30 seconds.
  Note: if I do the same thing from another Unix box running docker everything works right so this is particular to docker for Windows running on Windows 10. For some reason this fails.</p>
  
  <p>I haven't been able to solve this. There are no HTTP proxies in the chain on either machine. It is on a local subnet. All other services on the server are accessible, etc. The "insecure-registries" in the Windows docker in the UI is set for both hosts and ports.</p>
  
  <p>Is it a bug? In Windows 10 docker? It works fine from another Ubuntu box.</p>