When using the docker run command, it's possible to specify what the DNS hosts of the container should be by passing --dns <dns_server_ip> arguments.
Is there an equivalent for the docker build command? There is nothing about it in the docs, and trying it throws an error.
A friend of mine suggested another solution:
use ADD to insert a /etc/resolv.conf into the container as the first build instruction. Then the container will use those settings for all future builds.
This has the benefit of being a per-container issue, so I don't need to make the change globally or start up a new VM.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With