Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Windows container cannot resolve host.docker.internal, but Linux container can. #10504

Closed
chambersDon opened this issue Mar 1, 2021 · 5 comments

Comments

@chambersDon
Copy link

My windows docker container cannot resolve host.docker.internal, but it's working with Linux containers.
I am on version 20.10.2. Could this be bug 1976 reported for version 18?

My application gives this runtime error:
System.Net.Sockets.SocketException: No such host is known

I've tried pinging host.docker.internal.

C:\app>ping host.docker.internal 
Ping request could not find host host.docker.internal. Please check the name and try again.

Here is my dockefFile:

FROM mcr.microsoft.com/dotnet/framework/runtime:4.8-windowsservercore-ltsc2019
ARG source
WORKDIR /app
COPY ${source:-SampleApp/obj/Docker/publish} .
ENTRYPOINT ["C:\app\SampleApp.exe"]


I also get the error with the command below, which is easier to reproduce:
docker run -d mcr.microsoft.com/dotnet/framework/runtime:4.8-windowsservercore-ltsc2019 ping host.docker.internal

I am Hyper-V backed.
**Docker version**
Client: Docker Engine - Community
 Cloud integration: 1.0.7
 Version:           20.10.2
 API version:       1.41
 Go version:        go1.13.15
 Git commit:        2291f61
 Built:             Mon Dec 28 16:14:16 2020
 OS/Arch:           windows/amd64
 Context:           default
 Experimental:      true

Server: Docker Engine - Community
 Engine:
  Version:          20.10.2
  API version:      1.41 (minimum version 1.24)
  Go version:       go1.13.15
  Git commit:       8891c58
  Built:            Mon Dec 28 16:26:48 2020
  OS/Arch:          windows/amd


I've tried this on two machines with the same result.

Diagnostics Bundle: C:\Users\CTCRRM~1\AppData\Local\Temp\1\AF0D2985-D97C-43EA-AD43-31EADA397DA0\20210301155047.zip
Diagnostics ID:     AF0D2985-D97C-43EA-AD43-31EADA397DA0/20210301155047 (uploaded)



@mikedennis
Copy link

I'm having similar problems. Inside my container:

C:\inetpub\wwwroot>nslookup host.docker.internal
Server:  UnKnown
Address:  172.30.192.1

*** UnKnown can't find host.docker.internal: Server failed

C:\inetpub\wwwroot>ping host.docker.internal
Ping request could not find host host.docker.internal. Please check the name and try again.

The image I am using is: mcr.microsoft.com/dotnet/framework/aspnet:4.7.2-windowsservercore-ltsc2019

Docker Desktop on Win10 - DockerEngine v20.10.2

@damonsential
Copy link

damonsential commented Mar 10, 2021

Running into this issue as well:

Client: Docker Engine - Community
 Cloud integration: 1.0.9
 Version:           20.10.5
 API version:       1.41
 Go version:        go1.13.15
 Git commit:        55c4c88
 Built:             Tue Mar  2 20:14:53 2021
 OS/Arch:           windows/amd64
 Context:           default
 Experimental:      true

Server: Docker Engine - Community
 Engine:
  Version:          20.10.5
  API version:      1.41 (minimum version 1.24)
  Go version:       go1.13.15
  Git commit:       363e9a8
  Built:            Tue Mar  2 20:26:56 2021
  OS/Arch:          windows/amd64
  Experimental:     true```

@doggy8088
Copy link

This issue was been tracking here: #1976

@docker-robott
Copy link
Collaborator

Issues go stale after 90 days of inactivity.
Mark the issue as fresh with /remove-lifecycle stale comment.
Stale issues will be closed after an additional 30 days 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
Copy link
Collaborator

Closed issues are locked after 30 days of inactivity.
This helps our team focus on active issues.

If you have found a problem that seems similar to this, please open a new issue.

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

@docker docker locked and limited conversation to collaborators Sep 12, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

5 participants