0

I'm attempting mDNS discovery from within a Docker container and running it using

sudo docker run --privileged -v /var/run/dbus:/var/run/dbus -v /var/run/avahi-daemon/socket:/var/run/avahi-daemon/socket -d -p 5001:5001 my_application

as shown in this post

When running avahi-browse within the container, I get this output:

root@38ca93e44ce1:/etc/avahi# avahi-browse -a
+ (null) IPv4 amzn.dmgr:2A9009CCFEAFDF82846897DD0D687295:xnVDMM+4u1:767308 Amazon Fire TV       local
+ (null) IPv6 Canon MG7700 series                           _uscan._tcp          local
+ (null) IPv4 Canon MG7700 series                           _uscan._tcp          local
+ (null) IPv6 Canon MG7700 series                           Secure Internet Printer local
+ (null) IPv4 Canon MG7700 series                           Secure Internet Printer local
+ (null) IPv6 Canon MG7700 series                           _scanner._tcp        local
+ (null) IPv4 Canon MG7700 series                           _scanner._tcp        local
+ (null) IPv6 Canon MG7700 series                           Internet Printer     local
+ (null) IPv4 Canon MG7700 series                           Internet Printer     local
+ (null) IPv6 Canon MG7700 series                           UNIX Printer         local
+ (null) IPv4 Canon MG7700 series                           UNIX Printer         local
+ (null) IPv4 Canon MG7700 series                           Web Site             local
+ (null) IPv4 Canon MG7700 series                           _canon-bjnp1._tcp    local
+ (null) IPv4 Canon MG7700 series                           _privet._tcp         local
+ (null) IPv6 Canon MG7700 series                           Web Site             local
+ (null) IPv6 Canon MG7700 series                           _canon-bjnp1._tcp    local
+ (null) IPv6 Canon MG7700 series                           _privet._tcp         local

I'm curious to why the network interface column is showing (null) and whether there's a way to actually show the proper interface (wlan0, eth0, etc.)

1 Answer 1

1

You're seeing (null) for the network interface because the container is running in an isolated network namespace -- it doesn't have any access to the host interfaces.

You could resolve this by running in the host network namespace (--net=host, which requires you to drop the -p option), which gives the container access to the host network environment.

At least in my testing, running a --privileged container doesn't appear to be necessary in either situation.

Not the answer you're looking for? Browse other questions tagged or ask your own question.