Docker Community Forums

Share and learn in the Docker community.

Another DNS Build question


(Tattoodtraveler) #1

I just found a workaround for my build dns problems. I use on offline repo and could only build a docker image when specifying the hosts with a --add-host for each host.

docker build --network=host was the only thing that worked for me using docker 18.06.1-ce on CentOS 7.5. I tried updating daemon.json, systemd, and resolv.conf on the host and container during build. --network=host works, but still not sure why the dns settings would not work. When the container builds, i can run it and see all the dns options i specified on the docker daemon are used in the container resolv.conf.