I have a website in IIS of my host machine which is accessible by http://mysite.local address. I also have a windows container running on this host and I\'m trying to connect to
You can get the command shell of the container as administrator and run the command:
docker exec --user "NT AUTHORITY\SYSTEM" -it yourcontainername cmd
Then you can add a proper record to hosts file of the container:
echo X.X.X.X mysite.local >> c:\windows\system32\drivers\etc\hosts
To make sure you are using proper value instead of X.X.X.X
, open hosts file of your host machine, and you will see a DNS entry like X.X.X.X host.docker.internal
. This is the IP of host in container's point of view. Use that IP in above command to add thee correct DNS entry to hosts file of the container. To test the result, you can see the content of the file using type c:\windows\system32\drivers\etc\hosts
and get contents from that website using curl mysite.local
.