MDNS from Docker

Hey, as I checked, you can install avahi/nss-mdns in your container, and will be able to scan and access other LAN devices through that. What exactly are you trying to do, and what have you tried out so far?

For example, using a Raspberry Pi 3, this worked for me:

Dockerfile:

FROM resin/raspberrypi3-debian:jessie

WORKDIR /usr/src/app/
ENV INITSYSTEM on

RUN apt-get update && \
    apt-get install -yq \
      avahi-daemon avahi-utils libnss-mdns

RUN systemctl enable avahi-daemon

COPY nsswitch.conf /etc/nsswitch.conf

CMD avahi-browse -a

and nsswitch.conf is a standard mdns-enabled version to include this line:
hosts: files mdns_minimal [NOTFOUND=return] dns

Then in the logs avahi-browse finds the other local devices, can ping by their .local name, etc…

Does any of this help, or it’s on the wrong track?