for-win icon indicating copy to clipboard operation
for-win copied to clipboard

Docker pull fails with "no route to host" when accessing insecure registry in LAN

Open cluick opened this issue 9 years ago • 35 comments

Expected behavior

We are using an insecure registry in our LAN which is reachable via "myhost:5000". I´ve added "myhost:5000" to the list of insecure registries in Docker Settings / Deamon and restarted docker. Now I´m expecting that I can pull a docker image from this registry.

Actual behavior

Executing "docker pull myhost:5000/kinf-4.3-components" on the Windows command line (cmd.exe) fails with the following output:

Using default tag: latest Pulling repository myhost:5000/kinf-4.3-components Error while pulling image: Get http://myhost:5000/v1/repositories/kinf-4.3-components/images: dial tcp 172.17.11.17:5000: getsockopt: no route to host

Information

Diagnostic ID: F842665D-53B2-4BDD-ADB4-BAE48A9FD28C/2017-02-23_16-42-32 docker -v: Docker version 1.13.1, build 092cba3 Network Settings:

  • Subnet Address: 10.0.75.0
  • Subnet Mask: 255.255.255.0

The output shows that docker resolved the hostname "myhost" to the correct IP 172.17.11.17.

Can you tell me how I can enable docker daemon to access the IP 172.17.11.17?

cluick avatar Feb 23 '17 15:02 cluick

@djs55 can you have a look at it ? it seems vpnkit can't foute to this particular IP

simonferquel avatar Mar 01 '17 12:03 simonferquel

Also experiencing this with rc7, then also after upgrade to 17.03.0-ce-win1 (10300).

It has been suggested by a colleague based on the url, that the docker engine is using the older version "v1" when pulling the image. Our company's repository has not supported that in quite some time. Not sure why the latest upgrade is inserting that.

TroyLDay avatar Mar 21 '17 21:03 TroyLDay

Finally, I completely uninstalled the software (which was marked as Beta at the bottom of the General tab), rebooted, and completely reinstalled the STABLE version...and the trouble went away.

TroyLDay avatar Mar 22 '17 17:03 TroyLDay

I still have the same problems, even after reinstallation of docker for windows. I´m now using the Docker Community Edition 17.12.0-ce-win47 (15139). Here is what I see in the Powershell console:

docker pull myhost:5000/iviews-5.1-components
Using default tag: latest
Error response from daemon: Get http://myhost:5000/v2/: dial tcp 172.17.11.17:5000: getsockopt: no route to host

I attached the "log.txt" from my latest retry... log.txt

cluick avatar Jan 30 '18 09:01 cluick

I'm having the same issue.

Docker version 17.12.0-ce, build c97c6d6

Reinstalling Docker (same version) did the job.

stphngrtz avatar Feb 21 '18 12:02 stphngrtz

Same problem here with Docker version 17.12.0-ce, build c97c6d6 ( W10 ) trying to pull from private registry : getsockopt: no route to host

i'm getting this error without any extra config Adding my private repo in "insecure-registries" reports the same error Adding the suffix to dns-search reports the same error

We have the same problem on another computer with a fresh install of docker window

laurentKTR avatar Mar 20 '18 09:03 laurentKTR

i have added bridge:none to the configuration so i was able to push to the private registry, but with this option now dotnet restore within dockerfile doesn't work anymore

laurentKTR avatar Apr 06 '18 19:04 laurentKTR

We just noticed that removing every other bridged network but the default helps aswell.

> docker pull our-private-repository:18082/our/image:latest
Error response from daemon: Get http://our-private-repository:18082/v2/: dial tcp 123.456.789.123:18082: getsockopt: no route to host

> docker network ls
NETWORK ID          NAME                       DRIVER              SCOPE
e177178a5c9f        bridge                     bridge              local
0f362e7e14a6        network-1                  bridge              local
0ddbf9bbe3e3        network-2                  bridge              local
1e0ccbec292a        host                       host                local
e1e07bcb3505        none                       null                local

> docker network rm 0f 0d

> docker pull our-private-repository:18082/our/image:latest
latest: Pulling from our/image
...
...

Weird 😕

stphngrtz avatar Apr 12 '18 12:04 stphngrtz

just adding that this problem occurs at the company because we are under active directory At home with my personal w10 and another computer ubuntu hosting the private repository i don't have this problem

laurentKTR avatar Apr 12 '18 13:04 laurentKTR

Got the same issue running a docker registry on a VM ubuntu host on my lan, api v2/_catalog calls are going through and i can use the repository from the vm, but when i try to use the registry from my windows laptop i get:

C:\Users\USER>docker pull 192.168.100.63:5000/firstimgtag
Using default tag: latest
Error response from daemon: Get https://192.168.100.63:5000/v2/: dial tcp 192.168.100.63:5000: getsockopt: no route to host

PS: Added this here because i guess it is a docker "client" problem and not with the docker registry

trippinCode avatar Apr 16 '18 09:04 trippinCode

Hi, i've got same problem. Using Windows 10 1607, Docker for Windows 18.03.0-ce-win59 (16762).

With ForceRemoveDocker.ps1 script, I can access network till switching from lan nic to wlan nic. Only uninstall & new install of docker for windows does not work for me. Problem exists after few minutes (first docker pull act, second pull does not work anymore).

I think its an problem with hyper-v. Because networking between containers still works. Only containers / docker pull -> DockerNAT -> host system -> lan does not work.

Example of things which does not work for me:

  • $ docker login <private-repo>
  • $ docker pull xxx
  • in container: apt update
  • in container: curl www.....com

Result: Error response from daemon: Get http://<private-repo>/v2/: dial tcp <private-repo's ip:port>: getsockopt: no route to host

pkehling-IAV avatar Apr 20 '18 11:04 pkehling-IAV

i'm still facing this issue in another way When i'm building vs2017 core console using docker compose, the nugets from internet are restored but i'm getting errors for nugets from our internal nuget repository.

Every thing works well when compiling from a linux machine

laurentKTR avatar Apr 20 '18 11:04 laurentKTR

Now I've downgraded to Docker Community Edition 17.06.0-ce-win18 2017-06-28. -> It acts like before (docker login / pulling / building works), i try if it fails in some hours again :-(

pkehling-IAV avatar Apr 20 '18 12:04 pkehling-IAV

Same problem here. Seems that the problem in the mac edition was solved: https://github.com/docker/for-mac/issues/1797

luizportela avatar Apr 25 '18 05:04 luizportela

I had the same problem, win10 18.03.1-ce . solved by: step1 Config host add one custom domain match harbor ip , eg: 172.17.xx.xx harbor.demo.local step2 Right click the docker icon and select the 'Switch to Windows containners' . step3 Right click the docker icon ->Settings-> Daemon -> Insecure registries -> add harbor.demo.local step4 open CMD and input [docker login -u admin -p Harbor12345 harbor.demo.local]

guoqingfu avatar Jun 11 '18 06:06 guoqingfu

Issues go stale after 90d of inactivity. Mark the issue as fresh with /remove-lifecycle stale comment. Stale issues will be closed after an additional 30d of inactivity.

Prevent issues from auto-closing with an /lifecycle frozen comment.

If this issue is safe to close now please do so.

Send feedback to Docker Community Slack channels #docker-for-mac or #docker-for-windows. /lifecycle stale

docker-robott avatar Sep 09 '18 04:09 docker-robott

/remove-lifecycle stale

cluick avatar Sep 09 '18 09:09 cluick

I can still reproduce the issue with the latest version of Docker for Windows. Can I somehow help to resolve it?

cluick avatar Sep 09 '18 09:09 cluick

still facing the problem with the latest version

laurentKTR avatar Sep 10 '18 07:09 laurentKTR

Version 2.0.0.0-win78 (28905) Channel: stable Build: c404a62

Still same error, fixed by removing all dangling networks, however networks should not impact how docker pull behaves.

alkuzad avatar Nov 29 '18 11:11 alkuzad