{"id":19167637,"url":"https://github.com/stefapi/docker-mdns-helper","last_synced_at":"2025-05-07T13:42:37.299Z","repository":{"id":144131899,"uuid":"451633481","full_name":"stefapi/docker-mdns-helper","owner":"stefapi","description":"Publish Docker labels or Treafik rules as Avahi ( zeroconf ) domains on your local network","archived":false,"fork":false,"pushed_at":"2022-03-30T21:56:45.000Z","size":24,"stargazers_count":3,"open_issues_count":0,"forks_count":2,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-31T10:42:21.458Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/stefapi.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-01-24T21:08:03.000Z","updated_at":"2023-08-14T17:42:58.000Z","dependencies_parsed_at":null,"dependency_job_id":"ea656336-e043-4747-808e-5015d3080698","html_url":"https://github.com/stefapi/docker-mdns-helper","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stefapi%2Fdocker-mdns-helper","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stefapi%2Fdocker-mdns-helper/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stefapi%2Fdocker-mdns-helper/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stefapi%2Fdocker-mdns-helper/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/stefapi","download_url":"https://codeload.github.com/stefapi/docker-mdns-helper/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249830834,"owners_count":21331355,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-09T09:38:43.443Z","updated_at":"2025-04-19T23:31:00.206Z","avatar_url":"https://github.com/stefapi.png","language":"Python","readme":"# Docker-mdns-helper\n\nThis service publishes CNAME records pointing to the local host over\n[multicast DNS](http://www.multicastdns.org) using the [Avahi](http://www.avahi.org/wiki/AboutAvahi)\ndaemon found in all major Linux distributions. Useful as a poor-man's service discovery or as a\nhelper for named virtual-hosts in development environments.\n\nSince Avahi is compatible with Apple's [Bonjour](https://www.apple.com/support/bonjour),\nthese names are usable from MacOS X and Windows too.\n\nThis works well with [Traefik](https://traefik.io/) and [Docker-Dashy-Helper](https://hub.docker.com/repository/docker/stefapi/docker-dashy-helper)\n\nGit repository of the Docker distribution is on [Github Docker-mDNS-Helper](https://github.com/stefapi/docker-mdns-helper)\n\n## TL;DR\n\nIt works out of the box, just:\n* Check that Avahi is installed on your system. If not, install it as root: `apt install avahi-daemon` for a Debian or Ubuntu system\n* Change the configuration in your `/etc/avahi/avahi-daemon.conf` file: uncomment or add `enable-dbus=yes`\n* Restart avahi. Type as root: `service avahi-daemon restart`\n* Launch docker-mdns-helper:\n```\n$ docker run -d --name=mdns -v /var/run/dbus/system_bus_socket:/var/run/dbus/system_bus_socket -v /var/run/docker.sock:/var/run/docker.sock stefapi/docker-mdns-helper:latest\n```\n\nThat's all !\n\n\n## Configuration\n\nAll the configuration is read from container labels (Like Traefik) and the Dashy configuration file is only written if the labels have changed.\n\n\n### CNAMES definition\n\nCNAMES are defined by the following parameters:\n\n`docker-mdns.enable` label conditions the following labels. If set to `true` the labels defined hereunder will be taken into account. if `docker-mdns.enable` is not specified, the default behavior is to enable the container definition unless the `--disable` parameter is specified when launching.\n\nIt reads the same container labels as Traefik to define CNAMES e.g. :\n\n```\n-l 'traefik.http.routers.r1.rule=Host(`r1example.local`)'\n-l 'traefik.https.routers.r1.rule=Host(`r2example.local`, `alterdomain.local`)'\n```\n\nCNAMES may be personalised by using the `docker-mdns.domain` label like this:\n\n````\n-l 'docker-mdns.domain=r3example.com'\n````\n\n**WARNING**:  Sub domains ( like `sub.example.local` ) seems not to work on all platforms. Use domains instead (like `sub-example.local`)\n\n## Command line arguments\n\nDocker-mdns-helper has no mandatory parameter.\n\nOptional parameter `-d` or `--disable` disables the automatic addition of docker containers to Dashy. You have to put the label `docker-mdns.enable=true` for each container to be added.\n\nOptional parameter `-D` or `--daemon` launches the program as a daemon. Only necessary if using it with systemd on host machine.\n\nOptional parameter `-l` or `--log` defines the filename to use to write logs to.\n\nOptional parameter `-r` or `--reset` when active, all domains which are no more published with a Treafik label or docker-mdns.domain label are removed from avahi. During the reconfiguration no domain published by docker-mdns-helper will be published causing a temporary domain failure\n\nOptional parameter `-t` or `--ttl` defines ttl of CNAMES publication. Default 60 seconds.\n\nOptional parameter `-w` or `--wait` defines pause between CNAMES scans on Docker. Default 5 seconds.\n\nOptional parameter `-v` or `--verbose` increase the level of verbosity of output.\n\nOptional parameter `-f` or `--force` publishes a CNAME without prior existence test. Accelerates the publication of CNAMES but if CNAMES are already published, this may crash Avahi.\n\nFollowing all theses options you could pass a list of CNAMES to publish\n\n## Installing\n\n`docker pull stefapi/docker-mdns-helper`\n\nCurrently there are AMD64 based builds.\n\n## Building\n\nGet git repository:\n\n`git pull https://github.com/stefapi/docker-mdns-helper`\n\nBuild Docker file:\n\n`docker build .`\n\n## Running\n\nYou have to attach 2 volumes:\n\n` -v /var/run/docker.sock:/var/run/docker.sock`\n\n` -v /var/run/dbus/system_bus_socket:/var/run/dbus/system_bus_socket`\n\nFirst is used to read docker configuration and the second is used to communicate with Avahi on host system\n\nFree Sample of container lauch:\n```\n$ docker run -d --name=mdns -v /var/run/dbus/system_bus_socket:/var/run/dbus/system_bus_socket -v /var/run/docker.sock:/var/run/docker.sock stefapi/docker-mdns-helper:latest -r domain.local anotherdomain.local\n```\n\n\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstefapi%2Fdocker-mdns-helper","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstefapi%2Fdocker-mdns-helper","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstefapi%2Fdocker-mdns-helper/lists"}