flungo-docker / avahi

Docker image for the Avahi mDNS/DNS-SD daemon.
MIT License
65 stars 32 forks source link

Avahi dbus #4

Open AlexZigante opened 3 years ago

AlexZigante commented 3 years ago

Hii, was just wondering if theres any way of enabling dbus internally? Making it run on container side and not host???? Im running rancher and i cant seem to find a way to run avahi dbus.

ghost commented 2 years ago

heh no there's a built in dns server that you get when you create a container with a bridge other than the default bridge that will only listen inside the container on 127.0.0.11, that doesn't respond authoritatively so good luck setting up a forwarder between it and an interface between the host and the guest; you can't really and it's disgusting anyway, it shouldn't even be there, at all in any capacity because they refuse toe expand on this idea that it might actually serve people's needs better to have it optionally listen for queries on the host side as well; this is really old news, and you can rest assured that they have no intention of improving it so you may as well look into writing your own network driver to do the job:

https://github.com/clandestinenetworks/python-docker-openvswitch-plugin

which actually is the only finer point of using docker is it's extensibility and the rest is pretty disappointing. "What do you want free" honestly there's a lot I wouldn't do that would speak to the problem, for free, but there's a lot that I've already done to some extent. That driver already uses iproute2 extensively for a lot of the setup the only part that is ovs is the bridge so it's only like, 5 lines of code. But, so then I guess the question is:

I guess let me know, I have to do it for my own purposes sooner or later whether its sooner or later depends on who else is interested.

AlexZigante commented 2 years ago

Sorry if I brought up a topic that pisses you off. I honestly really didn't mean to piss you off. I was trying to get up and running a few tools. On Arch linux I use Avahi with a hanky old python tool that announces cnames over mdns. I tired to run this two containers that replicate same thing. But then somehow didn't work and I came to the conclusion it must be dbus.

ghost commented 2 years ago

@AlexR00T nah you're fine, its not you at all, there are a ton of people who have this problem and I can't imagine docker developers are strangers to it. Eventually I figured out on my own that the right way to fix the problem is to write a driver, but if you look at stack overflow it's years worth of the same questions about docker and dns and the answer "you can't" and frankly it's turned a lot of people off from docker now and subsequently it's become a contentious topic like systemd which ironically does everything I ever wanted it to do better than anything else but people in my groups are hard headed.

It seems in my mind very unlikely that trying to develop anything directly for docker's default driver (improving whats there already for DNS) would be very productive if even on the table. But it turns out that running a custom network driver is actually really easy if it works correctly (if it's broken you won't want to use it at all.) When I wrote my ovs driver I couldn't find anything around that was also written in python so I had to figure out everything from docs but it really wasn't that much. I might take another stab at making something with good DNS support, the thing thats hard is just making sure it's not buggy (for this it's hardly useful if it is.)

AlexZigante commented 2 years ago

@clandestinenetworks thanks for your replies and all understood. Well I just wish you a wonderful rest of the day, rest of 2021 and happy 2022.