My windows docker container cannot resolve host.docker.internal, but it's working with Linux containers. I would prefer to stay with Linux containers, but I am having trouble with an old .Net framework 4.7.2 application.
My application connects to RabbitMQ on the local machine. This works as expected in the Linux containers, but with the windows container it throws this 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 dockerFile:
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 am using docker version 20.10.2, and docker desktop version 3.1.0.
I'm running on Windows 10, version 10.0.18363.