After changing networks (ie traveling between home and work), the container's /etc/resolv.conf will reflect the previous DNS settings which results in DNS not working in the container.
Steps to reproduce the behavior
Start a long running container on your laptop (which is using systemd-resolved), then move to a different network with different DNS servers. Notice that the resolv.conf inside the container is now wrong.
Expected behavior
When I move my laptop to different networks or join a VPN, the /etc/resolv.conf in the container should update to match my system's new DNS settings.
https://docs.docker.com/v17.09/engine/userguide/networking/default_network/configure-dns/ mentions that there is a change notifier for the host's /etc/resolv.conf so container resolv.conf files will be updated. I'd like to see similar behavior when using systemd-resolved
Actual behavior
After changing networks (ie traveling between home and work), the container's /etc/resolv.conf will reflect the previous DNS settings which results in DNS not working in the container.
Steps to reproduce the behavior
Start a long running container on your laptop (which is using systemd-resolved), then move to a different network with different DNS servers. Notice that the resolv.conf inside the container is now wrong.
Output of
docker version
:Output of
docker info
: