Skip to content

Add --mdns to advertise a container's mDNS services on the host's networks - #2528

Open
tonycoco wants to merge 1 commit into
apple:mainfrom
tonycoco:feature/mdns-advertise
Open

tonycoco wants to merge 1 commit into
apple:mainfrom
tonycoco:feature/mdns-advertise

Conversation

@tonycoco

Copy link
Copy Markdown

A container's mDNS announcements reach the host on the interface of the container's network and go no further, and they name an address that only the host can reach. Applications that rely on being discovered, such as a HomeKit bridge, are therefore invisible to the rest of the network even when their port is published.

With --mdns, the runtime helper finds the services that the container announces and registers each one with the host's mDNS responder on the host's other interfaces, as a service of the host on the published host port. The registrations follow the container: TXT record and port changes are carried over, and a service is withdrawn when the container stops announcing it or stops.

  • Only services on published ports are advertised, and --mdns without --publish is rejected.
  • Only services whose host resolves to the container's address are advertised, because the host's own services and other containers are visible on the same interface.
  • A service is never registered on the container's network, where the container owns the name, and at most once per IP network, because two registrations on one link can conflict with each other when the TXT record is updated.

The option is off by default and stored in the container configuration. See docs/architecture/mdns.md.

Type of Change

  • Bug fix
  • New feature
  • Breaking change
  • Documentation update

Testing

  • Tested locally
  • Added/updated tests
  • Added/updated docs

…works

A container's mDNS announcements reach the host on the interface of the
container's network and go no further, and they name an address that only
the host can reach. Applications that rely on being discovered, such as a
HomeKit bridge, are therefore invisible to the rest of the network even
when their port is published.

With --mdns, the runtime helper finds the services that the container
announces and registers each one with the host's mDNS responder on the
host's other interfaces, as a service of the host on the published host
port. The registrations follow the container: TXT record and port changes
are carried over, and a service is withdrawn when the container stops
announcing it or stops.

- Only services on published ports are advertised, and --mdns without
  --publish is rejected.
- Only services whose host resolves to the container's address are
  advertised, because the host's own services and other containers are
  visible on the same interface.
- A service is never registered on the container's network, where the
  container owns the name, and at most once per IP network, because two
  registrations on one link can conflict with each other when the TXT
  record is updated.

The option is off by default and stored in the container configuration.
See docs/architecture/mdns.md.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant