gliderlabs / resolvable

Host-level DNS gateway for Docker
MIT License
315 stars 37 forks source link

Support for systemd-resolve #32

Open smihael opened 3 years ago

smihael commented 3 years ago

This image uses systemd-networkd to regenerate the host's /etc/resolv.conf. However, on Ubuntu 20.04-based systems resolv.conf is linked to ../run/systemd/resolve/stub-resolv.conf which hints to the use of systemd-resolve service.

This causes error as/tmp/systemd/network is not present.

$ docker run  --hostname resolvable -v /var/run/docker.sock:/tmp/docker.sock -v /run/systemd:/tmp/systemd   -v /var/run/dbus/system_bus_socket:/var/run/dbus/system_bus_socket  mgood/resolvable

2021/01/05 00:59:19 Starting resolvable 0.2 ...
2021/01/05 00:59:19 got local address: 172.17.0.2
2021/01/05 00:59:19 systemd: systemd-resolved.service: loading config from /config/systemd/resolved.conf.d/*.conf
2021/01/05 00:59:19 systemd: template: pattern matches no files: `/config/systemd/resolved.conf.d/*.conf`
2021/01/05 00:59:19 systemd: systemd-networkd.service: loading config from /config/systemd/network/*.network
2021/01/05 00:59:19 systemd: generating /tmp/systemd/network/99-resolvable.network
2021/01/05 00:59:19 systemd: open /tmp/systemd/network/99-resolvable.network: no such file or directory
2021/01/05 00:59:19 systemd: %s: no configs written, skipping reload systemd-networkd.service