# Homey CLI run with Docker host networking

**URL:** <https://community.homey.app/t/homey-cli-run-with-docker-host-networking/86235>\
**Category:** Developers\
**Created:** [August 5, 2023, 3:04pm UTC](https://community.homey.app/t/homey-cli-run-with-docker-host-networking/86235 "2023-08-05T15:04:57Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![torarnv](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/torarnv/32/83065_2.png) [@torarnv](https://community.homey.app/u/torarnv)\
**Post date:** [August 5, 2023, 3:04pm UTC](https://community.homey.app/t/homey-cli-run-with-docker-host-networking/86235/1 "2023-08-05T15:04:57Z")

</div>

I’m trying to run an app locally during development, and suspect that it’s failing to enumerate devices in my network because it’s failing to do UDP multicast.

It looks like the `homey app run` command runs the app with bridge networking. Is there a way to tell `homey-cli` to use host networking (besides trying to manually replicate the `docker run` command)?

---

<div class="post-metadata">

**Author:** ![Adrian\_Rockall](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/adrian_rockall/32/13209_2.png) [@Adrian\_Rockall](https://community.homey.app/u/Adrian_Rockall)\
**Post date:** [August 5, 2023, 3:44pm UTC](https://community.homey.app/t/homey-cli-run-with-docker-host-networking/86235/2 "2023-08-05T15:44:50Z")

</div>

If it’s a HP2023 then you can use:  
homey run --remote  
It will then run on the Homey like the old Homey used to.

---

<div class="post-metadata">

**Author:** ![torarnv](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/torarnv/32/83065_2.png) [@torarnv](https://community.homey.app/u/torarnv)\
**Post date:** [August 5, 2023, 3:56pm UTC](https://community.homey.app/t/homey-cli-run-with-docker-host-networking/86235/3 "2023-08-05T15:56:59Z")

</div>

Good idea. I tried that, but then the app still has issues resolving IPs, so perhaps it’s not the multicast. Just thought I’d try to reproduce with host networking locally to see if that helped.

---

<div class="post-metadata">

**Author:** ![torarnv](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/torarnv/32/83065_2.png) [@torarnv](https://community.homey.app/u/torarnv)\
**Post date:** [August 5, 2023, 4:02pm UTC](https://community.homey.app/t/homey-cli-run-with-docker-host-networking/86235/4 "2023-08-05T16:02:52Z")

</div>

Actually, now it works with `-r` so I guess the lack of. multicast was the issue. Would be nice if `homey cli` had the option to run with host networking for these use-cases.

---

<div class="post-metadata">

**Author:** ![robertklep](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/robertklep/32/160628_2.png) [@robertklep](https://community.homey.app/u/robertklep)\
**Post date:** [August 5, 2023, 4:07pm UTC](https://community.homey.app/t/homey-cli-run-with-docker-host-networking/86235/5 "2023-08-05T16:07:11Z")

</div>

You can always modify your local version of `homey` so that it does.

---

<div class="post-metadata">

**Author:** ![torarnv](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/torarnv/32/83065_2.png) [@torarnv](https://community.homey.app/u/torarnv)\
**Post date:** [August 5, 2023, 4:09pm UTC](https://community.homey.app/t/homey-cli-run-with-docker-host-networking/86235/6 "2023-08-05T16:09:52Z")

</div>

True, I didn’t realize it was open source, but I can just patch [GitHub - athombv/node-homey: Homey Command-Line Interface (CLI)](https://github.com/athombv/node-homey)

Resolving the docker run command via `docker inspect \ --format "$(curl -s https://gist.githubusercontent.com/efrecon/8ce9c75d518b6eb863f667442d7bc679/raw/run.tpl)" \ container name`  
did not work, probably because `home-cli` also sets up a web socket to the homey or things like that (?)

---

<div class="post-metadata">

**Author:** ![robertklep](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/robertklep/32/160628_2.png) [@robertklep](https://community.homey.app/u/robertklep)\
**Post date:** [August 5, 2023, 4:13pm UTC](https://community.homey.app/t/homey-cli-run-with-docker-host-networking/86235/7 "2023-08-05T16:13:54Z")

</div>

Yes, it does quite a lot before starting the container. The quickest solution would be to [modify the options](https://github.com/athombv/node-homey/blob/ef559da3281ba1e6f66d1f14c08be93ce8253210/lib/App.js#L655) in `App.js`.

---

<div class="post-metadata">

**Author:** ![torarnv](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/torarnv/32/83065_2.png) [@torarnv](https://community.homey.app/u/torarnv)\
**Post date:** [August 5, 2023, 4:22pm UTC](https://community.homey.app/t/homey-cli-run-with-docker-host-networking/86235/8 "2023-08-05T16:22:11Z")

</div>

Okey, that wasn’t too hard:

> <https://gist.github.com/torarnv/d2f15f00465e3f618bd0acd57f21e402>

Unfortunately it didn’t solve my problem with failing to do UDP multicast

---

<div class="post-metadata">

**Author:** ![torarnv](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/torarnv/32/83065_2.png) [@torarnv](https://community.homey.app/u/torarnv)\
**Post date:** [August 5, 2023, 7:01pm UTC](https://community.homey.app/t/homey-cli-run-with-docker-host-networking/86235/9 "2023-08-05T19:01:34Z")

</div>

After setting up Colima with socket\_vmnet networking, following these links:

- [Home Assistant on M1 Macs, the proper way - Ixion's blog](https://blog.illixion.com/2023/04/colima-home-assistant/)
- [Run multiple Kubernetes clusters on MacOS with LoadBalancer support · Baptiste Collard](https://baptistout.net/posts/kubernetes-clusters-on-macos-with-loadbalancer-without-docker-desktop/)
- [GitHub - lima-vm/socket\_vmnet: vmnet.framework support for unmodified rootless QEMU (no dependency on VDE)](https://github.com/lima-vm/socket_vmnet)

I was able to get UDP multicast working, with the added `--network host` option to homey CLI added here:

> <https://github.com/athombv/node-homey/pull/353>
>
> Allows running app during local development with host networking, which is requi…red for UDP multicast, which some apps use for device discovery.
> 
> On non-Linux systems this requires a Docker setup that bridges the Docker VM with the host, for example Colima in combination with socket\_vmnet, as documented e.g:
> 
> \* https://blog.illixion.com/2023/04/colima-home-assistant/
> \* https://baptistout.net/posts/kubernetes-clusters-on-macos-with-loadbalancer-without-docker-desktop/
> \* https://github.com/lima-vm/socket\_vmnet
