Title: Code running in docker container doesn't find services on host network · Issue #1453 · python-zeroconf/python-zeroconf · GitHub
Open Graph Title: Code running in docker container doesn't find services on host network · Issue #1453 · python-zeroconf/python-zeroconf
X Title: Code running in docker container doesn't find services on host network · Issue #1453 · python-zeroconf/python-zeroconf
Description: 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", "cre...
Open Graph Description: 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)] ...
X Description: 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....
Opengraph URL: https://github.com/python-zeroconf/python-zeroconf/issues/1453
X: @github
Domain: patch-diff.githubusercontent.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Code running in docker container doesn't find services on host network","articleBody":"Hi, I'm running python-zeroconf in a docker container on a mac host. If I run the following on the mac host:\r\n\r\n```bash\r\n$ python3\r\nPython 3.13.1 (main, Dec 3 2024, 17:59:52) [Clang 16.0.0 (clang-1600.0.26.4)] on darwin\r\nType \"help\", \"copyright\", \"credits\" or \"license\" for more information.\r\n\u003e\u003e\u003e import zeroconf\r\n\u003e\u003e\u003e from zeroconf import ZeroconfServiceTypes\r\n\u003e\u003e\u003e print('\\n'.join(ZeroconfServiceTypes.find()))\r\n_androidtvremote2._tcp.local.\r\n_companion-link._tcp.local.\r\n_googlecast._tcp.local.\r\n_googlerpc._tcp.local.\r\n_googlezone._tcp.local.\r\n_spotify-connect._tcp.local.\r\n\u003e\u003e\u003e\r\n```\r\nIt finds services as expected.\r\n\r\nIf I try the same thing on a docker container (with --network=host) I get:\r\n\r\n```bash\r\n$ python\r\nPython 3.12.7 (main, Oct 1 2024, 22:26:44) [GCC 10.2.1 20210110] on linux\r\nType \"help\", \"copyright\", \"credits\" or \"license\" for more information.\r\n\u003e\u003e\u003e \r\n\u003e\u003e\u003e \r\n\u003e\u003e\u003e from zeroconf import ZeroconfServiceTypes\r\n\u003e\u003e\u003e print('\\n'.join(ZeroconfServiceTypes.find()))\r\n\r\n\u003e\u003e\u003e\r\n```\r\n\r\nNothing... Is there something obvious I am missing that would cause this despite the fact that the container is on the host network?","author":{"url":"https://github.com/andy-todd-dev","@type":"Person","name":"andy-todd-dev"},"datePublished":"2024-12-21T20:31:46.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":0},"url":"https://github.com/1453/python-zeroconf/issues/1453"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:99e82592-7173-66a4-c955-6c9edec85773 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 8286:348ACE:9375E1:CF8FF9:69725149 |
| html-safe-nonce | 2de1c15c9f4d0546764d66d5e9794af2d39b9c44a9ebc46ece2cb52f2d41cac7 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4Mjg2OjM0OEFDRTo5Mzc1RTE6Q0Y4RkY5OjY5NzI1MTQ5IiwidmlzaXRvcl9pZCI6IjI3NTIzMjg5ODYyMzMyOTUxNzciLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 12ebbeec644f391981d7a0cb7f11e4d5da91354fbc1dd39cc02732202852effa |
| hovercard-subject-tag | issue:2754351806 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/python-zeroconf/python-zeroconf/1453/issue_layout |
| twitter:image | https://opengraph.githubassets.com/01cbf5a9dbf0102fdb580ed68c8c997209a9a77185cf05b46bcb12506353fa05/python-zeroconf/python-zeroconf/issues/1453 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/01cbf5a9dbf0102fdb580ed68c8c997209a9a77185cf05b46bcb12506353fa05/python-zeroconf/python-zeroconf/issues/1453 |
| og:image:alt | 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)] ... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | andy-todd-dev |
| hostname | github.com |
| expected-hostname | github.com |
| None | f6d9b08324bb62b2cf170b9e435da2bdc7efa5aa93e7ca70ee3162552c05329b |
| turbo-cache-control | no-preview |
| go-import | github.com/python-zeroconf/python-zeroconf git https://github.com/python-zeroconf/python-zeroconf.git |
| octolytics-dimension-user_id | 120192235 |
| octolytics-dimension-user_login | python-zeroconf |
| octolytics-dimension-repository_id | 21548731 |
| octolytics-dimension-repository_nwo | python-zeroconf/python-zeroconf |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 21548731 |
| octolytics-dimension-repository_network_root_nwo | python-zeroconf/python-zeroconf |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 169d2b5c72bff9cc676084f0ac7f8ea888f15f54 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width