问题
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