libnetwork
libnetwork copied to clipboard
--network none (--net=none) emits logs of DNS-related operations
Using Docker 18.09.7, when launching a container with docker run --network none ..., logs like these are generated:
dockerd[1768]: time="2020-03-17T14:00:52.808585281-07:00" level=info msg="No non-localhost DNS nameservers are left in resolv.conf. Using default external servers: [nameserver 8.8.8.8 nameserver 8.8.4.4]"
dockerd[1768]: time="2020-03-17T14:00:52.808612717-07:00" level=info msg="IPv6 enabled; Adding default IPv6 external servers: [nameserver 2001:4860:4860::8888 nameserver 2001:4860:4860::8844]"
I dug through the Go code as best I could, but it seems to me that FilterResolvDNS is getting called by setupDNS nearly unconditionally (i.e. no check to see if networking is enabled or not), and updateDNS semi-conditionally (--network host seems to bypass this). I couldn't figure out what to add if-wise, nor where to add it, to essentially do nothing in the case --network none is used; I'm not familiar with the code to know what's needed.
This issue is indirectly touched on/referenced via #1063 and #1928 .
Use case justification: we have applications and infrastructure that launches Docker containers for single-command usage, so having thousands of these log messages when using containers launched with --network none (and containers which truly do no network I/O of any kind) seems very wasteful.
@jchadwick-smug do you see this in the latest version as well (19.03.7)
Edit: apologies -- the latest I can test is 19.03.6. Is there evidence you can point me to that 19.03.7 would solve this problem? The problem is still present on 19.03.6.
should be the same @jchadwick-smug .
I'm running docker run --net none nginx and I can't seem to generate the logs you have shared