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
I run into the same problem, but neiter uncommenting /etc/default/docker dns entries nor editing the /etc/resolv.conf in the build container or the /etc/docker/daemon.json helps for me.
But after I build with the option --network=host the resolving was fine again.
docker build --network=host -t my-own-ubuntu-like-image .
Maybe this will help someone again.