8000 Code running in docker container doesn't find services on host network · Issue #1453 · python-zeroconf/python-zeroconf · GitHub
[go: up one dir, main page]

Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
andy-todd-dev opened this issue Dec 21, 2024 · 0 comments
Open

Comments

@andy-todd-dev
Copy link
andy-todd-dev commented Dec 21, 2024

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?

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

No branches or pull requests

1 participant
0