I am attempting to write Dockerfile instructions to use yum and install a few packages. When I run my build command, I will always get an error...
(28, 'Resolving timed out after 5000 milliseconds')
... due to the lack of network access. I have compared my host and container /etc/resolv.conf, and noticed they were different.
Example (Host)
# Generated by expressvpn
search expressvpn
nameserver 10.53.0.1
Example (Container)
search expressvpn
nameserver 10.1.2.3
nameserver 8.8.8.8
I attempted copying the host /etc/resolv.conf and overwriting the container /etc/resolv.conf as follows
$ echo "# Generated by expressvpn
> search expressvpn
> nameserver 10.53.0.1" > "/etc/resolv.conf"
Then immediately gained network access again and was able to use yum. However, if I try reading the Dockerfile with a build command, it does not seem to work anymore. How do I make docker use the host resolv.conf on build or resolve this issue correctly? It seemed to not have an issue with my VPN before. Is that the issue now?
/etc/docker/daemon.jsonor with CLI flags?/etc/docker/daemon.jsonwhen I restart my host or change any VPN settings, but I am back in business with at least testing!