Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Code running in docker container doesn't find services on host network #1453

Copy link
Copy link
Open
@andy-todd-dev

Description

@andy-todd-dev
Issue body actions

Hi, I'm running python-zeroconf in a docker container on a mac host. If I run the following on the mac host:

$ python3
Python 3.13.1 (main, Dec  3 2024, 17:59:52) [Clang 16.0.0 (clang-1600.0.26.4)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import zeroconf
>>> from zeroconf import ZeroconfServiceTypes
>>> print('\n'.join(ZeroconfServiceTypes.find()))
_androidtvremote2._tcp.local.
_companion-link._tcp.local.
_googlecast._tcp.local.
_googlerpc._tcp.local.
_googlezone._tcp.local.
_spotify-connect._tcp.local.
>>>

It finds services as expected.

If I try the same thing on a docker container (with --network=host) I get:

$ python
Python 3.12.7 (main, Oct  1 2024, 22:26:44) [GCC 10.2.1 20210110] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> 
>>> 
>>> from zeroconf import ZeroconfServiceTypes
>>> print('\n'.join(ZeroconfServiceTypes.find()))

>>>

Nothing... Is there something obvious I am missing that would cause this despite the fact that the container is on the host network?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.