This image uses Darell Tan's mdns-repeater to bridge/repeat mDNS requests between two network interfaces.
The intended use of this container is to allow a docker-compose stack running in net=bridge mode to be able to communicate with the Docker host's external network.
Image on Docker Hub: https://hub.docker.com/repository/docker/jdbeeler/mdns-repeater
This container was designed to be used as part of a docker-compose stack. When creating the configuration file:
- Use docker-compose version 3.5 or later
- Ensure that each of the bridged containers are part of the same, named network
- Ensure that the network is named in the networks:section
- Create & link an environment variable file similar to env.sample to your mdns_repeater image (or set the appropriate environment variables in the stack's configuration)
See mdns_repeater in the example docker-compose file below for the other attributes necessary to run the container.
There are three environment variables that must be set:
- EXTERNAL_INTERFACE - The interface name of the external interface we want to bridge (e.g. eth0,wlan0, etc.)
- DOCKER_NETWORK_NAME - The name of the named network in the stack (walledin the example below)
- USE_MDNS_REPEATER - A flag that can be used to disable the application. Intended use case is if we want to disable the repeater from an environment variable (without needing to edit docker-compose.yml)
version: '3.5'
services:
  redis:
    image: redis:5.0
    networks:
      - walled
  nginx:
    image: nginx
    networks:
      - walled
  mdns_repeater:
    image: jdbeeler/mdns-repeater:latest
    network_mode: "host"
    privileged: true
    env_file:
      - ./envs/mdns-repeater
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock
networks:
  walled:
    name: walled
mdns-repeater.c was obtained from kennylevinsen's fork of Darell Tan's mdns-repeater.c
The original dockerization of mdns-repeater was done by angelnu
Licensing is GPLv2 as inherited from Darell Tan's mdns-repeater.c.