Skip to content
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

Docker Desktop: Host Networking on macOS and Windows. #570

Open
cpressland opened this issue Sep 14, 2024 · 5 comments
Open

Docker Desktop: Host Networking on macOS and Windows. #570

cpressland opened this issue Sep 14, 2024 · 5 comments

Comments

@cpressland
Copy link

Current Situation

The wiki states here that Windows and macOS are not supported as they lack the --net=host parameter. This is no longer the case in Docker Desktop 4.34.0. Homebridge does indeed start and appears to function as expected with one minor issue, the detected IP addresses are that of the docker container itself, and not the host.

Proposed Change

Allow a configuration variable to force Homebridge to advertise itself on a given IP address even if it's not bound to it, this should allow HomeKit to find the Homeridge instance.

Additional Context

Docker Desktop documentation: https://docs.docker.com/engine/network/drivers/host/#docker-desktop

@NorthernMan54 NorthernMan54 transferred this issue from homebridge/homebridge Sep 25, 2024
@NorthernMan54
Copy link
Contributor

Let me test this out, then will update the documentation.

Copy link

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@github-actions github-actions bot added the stale label Oct 25, 2024
Copy link

This issue has been closed as no further activity has occurred.

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Oct 30, 2024
@NorthernMan54 NorthernMan54 reopened this Oct 30, 2024
@github-actions github-actions bot removed the stale label Oct 31, 2024
@gidd-bud
Copy link

Noticed this issue has been re-opened. When will it be fixed? Recently I was having trouble adding HomeBridge to HomeKit.

@NorthernMan54
Copy link
Contributor

So I took some time today to look at this closer on my Intel Mac mini, running macOS Monterey. And while I was able to make some progress, was not able to get homebridge to work.

For the setup, I first enabled host networking in the Docker Desktop

Screen Shot 2024-12-18 at 10 47 10 AM

I then used the current docker-compose.yml file for docker-home bridge, and was able to start homebridge. And was able to access the UI via the url http://docker-desktop.local:8581

I was able to install a couple of plugins without issue, and things appeared to work from the Homebridge UI side of things.

But I was unable to pair Homebridge with the home app on my phone.

And looking deeper, the issue is how Docker handle's local ip addresses on MacOS versus linux. On linux the docker container uses the same IP address as the host, while on MacOS it uses its own IP address on a different network.

Screen Shot 2024-12-18 at 11 13 59 AM

My host / primary network is 192.168.1.x, and not what you see here.

What was interesting, was that I could access the homebridge instances and the UI remotely by using the host computers IP address and the proper port number from inside the container.

To get homebridge to work, we would likely need to fool the mDNS Advertiser to think it is working from the host interface, and use its IP address in the advertisements.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants