NetService not working on swift Docker Official Image
When trying NetService with NetService-example on the swift Docker Official Image, I am getting the following warning messages and NetService is not working (not publishing, nor browsing services):
root@docker-desktop:/singular/NetService-Example-master# .build/debug/NetService-Example *** WARNING *** The program 'NetService-Example' uses the Apple Bonjour compatibility layer of Avahi. *** WARNING *** Please fix your application to use the native API of Avahi! *** WARNING *** For more information see http://0pointer.de/blog/projects/avahi-compat.html
Building and running NetService-example in Xcode, seems to be working fine.
Any idea on how to get NetService to work on the swift Docker Official Image?
NetService uses Avahi, so start debugging there. Can you publish a service with Avahi? Once you’ve got that working, I expect NetService to just work as well.
Installed avahi-utils and "avahi-browse -a" returns:
root@docker-desktop:/singular/NetService-Example-master# avahi-browse -a Failed to create client object: Daemon not running
The avahi daemon is apparently not running in the container. I confirmed this with "/etc/inet.d/avahi-daemon status":
root@docker-desktop:/singular/NetService-Example-master# /etc/init.d/avahi-daemon status Avahi mDNS/DNS-SD Daemon is not running
Trying to start the Avahi daemon with "/etc/init.d/avahi-daemon start" but still daemon is not starting...
mkdir /run/dbus
dbus-daemon --system
avahi-daemon -D