Docker - Windows Container Not Resolving Hosts

狂风中的少年 提交于 2020-01-05 08:30:29

问题


I have set up two new projects in Visual Studio using the Docker tooling. The first is a asp.net site running against a Linux container. The second is an asp.net site running against a Windows container.

In the former, I can ping hostnames (ex: google.com) and it resolves just fine.

However, when running the windows container I cannot do the same thing.

I am running a custom network so that I can ensure the container starts up on the subnet I want:

docker network create --driver=nat --subnet=192.168.221.0/24

To be clear, I can ping just fine by using an IP but since I want to connect to a database via hostname, this isn't especially helpful during development.

来源:https://stackoverflow.com/questions/51885539/docker-windows-container-not-resolving-hosts

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!