alexryd / node-shellies

Handles communication with Shelly devices
MIT License
35 stars 13 forks source link

Docker execution #16

Closed jmendiara closed 3 years ago

jmendiara commented 3 years ago

I'm trying to execute the cli inside a docker container, but unfortunately, no devices are discovered. Native execution directly in the host works perfectly.

I've tried using with and without the host network for the container. I'm using a MAC, so maybe there are limitations on docker networking and the multicast addr

Any clue?

Keep up this good work!

FROM node:12.16.1-stretch

RUN npm i -g shellies

ENTRYPOINT ["shellies"]
CMD ["listen"]
docker build -t shellies .

# check is working
docker run --network=host shellies --help
node-shellies 1.1.1

Valid commands: listen, description, status
docker run --network=host shellies listen
# ..... anything found
alexryd commented 3 years ago

I don't have a lot of experience using Docker, but I did some googling and found this in the docs:

"The host networking driver only works on Linux hosts, and is not supported on Docker Desktop for Mac, Docker Desktop for Windows, or Docker EE for Windows Server."

So I suppose it's not supported on a Mac?

jmendiara commented 3 years ago

Yeah, sadly i suppose the host operating system it's the limitation here. That issue was just in case there were some issue within the way you are connecting with UDP. Thanks for your time!