Recently I realized, the network security makes it hard to run a local DNS server. When you are inside a container and realize, you are crippled due to the simple fact, there is no DNS. For some reason I was also unable to access the default Hyper-V DNS inside the container.
First I tried to manually replace the
/etc/resolve.conf. But that didn't help. Then I remembered I was connected to the more secure corp net. For that there was a simple fix:
- Pull the ethernet cable
- Disconnect from Corp WiFi
- Connect to the guest WiFi (yes guest config allows public DNS)
Finally I have DNS resolutions.
But that means I have to replace DNS config in
/etc/resolve.conf. Then I remembered that docker has
--dns argument. It didn't take much time to realize,
docker build doesn't have
Search continues for more permanent solution.
Then today I was in
dockerd. As a experiment, I added:
"dns": [ "184.108.40.206", "220.127.116.11" ]
Finally, no need to add
--dns argument every time I ran a container at work, and
docker build works like charm.
Sometimes, it just pays off to just read the documentation.