I\'ve been trying to run Docker build on various files which previously worked before, which are now no longer working.
As soon as the Docker file included any line
Same issue for me (on Ubuntu Xenial).
docker run --dns ... for containers worked. docker build (docker-compose etc.) did not work.After analyzing the docker logs (journalctl -u docker.service) if found some warning about bad resolvconf applied.
Following that i found that our corporate nameservers were added to the network interfaces but not in resolvconf.
Applied this solution How do I configure my static DNS in interfaces? (askubuntu), i.e. adding nameservers to /etc/resolvconf/resolv.conf.d/tail
After updating resolvconf (or reboot).
bash
docker run --rm busybox nslookup google.com
worked instantly.
All my docker-compose builds are working now.