How to configure ipv4 / ipv6 settings

I found a solution in this thread here.

I looked up my DNS servers in resolv.conf, and put that in the configuration file for docker.
I don’t know why docker doesn’t use the same dns as the rest of the system by default?
What am I not understanding here?