logantgt / EcpEmuServer

Trigger webhooks from your Logitech Harmony (or other Roku ECP compatible) Universal Remote
MIT License
19 stars 2 forks source link

is Docker image available? #7

Open marcolino7 opened 6 months ago

marcolino7 commented 6 months ago

Hi, is there a docker image available? Thanks

erdoking commented 3 months ago

I can`t find on so i make my own image At the moment just the gui is testet but working.

Update follow... If it working well i put it on docker hub.


FROM ubuntu:jammy
WORKDIR /app
RUN apt update
RUN apt install wget curl unzip dotnet7 -y
RUN wget https://github.com/logantgt/EcpEmuServer/releases/download/v0.3/EcpEmuServer-v0.3-linux_x64.zip
RUN unzip EcpEmuServer-v0.3-linux_x64.zip
WORKDIR /app/EcpEmuServer-v0.3-linux_x64
RUN chmod +x EcpEmuServer
CMD ["./EcpEmuServer"]
EXPOSE 8060
EXPOSE 1900/udp
``
marcolino7 commented 3 months ago

Hi, I think 8060 port is not enought, there should be other port to permit server to be discovered.....and looking at the code it seems to be port 1900. Here is some info: https://community.roku.com/t5/Wi-Fi-connectivity/Roku-Error-009-Firewall-Issue/td-p/774926 I will work on your dockerfile if I have some time in this days Perhaps you should add also curl into image, in order to call external API. For now I use al LXC container on Proxmox, with Debian 12 as OS. Let me know your findings and I will let you know mine

regards

erdoking commented 3 months ago

Hi marcolino7

thank you! I have adapted my template. Tests need some more time ...

marcolino7 commented 3 months ago

Hi marcolino7

thank you! I have adapted my template. Tests need some more time ...

I did some test, getting container running, web interface ok, but server is not discoverable from my Sofabaton X1 Hub. I will work on it.

Marco

marcolino7 commented 3 months ago

I got working exposing all container's network to host:

docker run \
--net=host \
docker-ecpemuserver:latest

Capturing a tcpdump on docker host: image

I got an explicative result. When Sofabaton Hub (Roku client) make a discovery on the network, I got a couple of multicast packet send from Sodabaton Hub (192.168.1.77) to Multicast address, and in this case, EcpEmuServer is available in Sofabaton Hub, so discovery works fine.

Looking around seem it is not possible to route multicast traffic to a docker's bridged network: https://github.com/moby/libnetwork/issues/2397#issuecomment-935029813 https://stackoverflow.com/questions/42422406/receive-udp-multicast-in-docker-container

in this case we must bind container to host network to make it work as Roku server

Marco

erdoking commented 3 months ago

i take some test with docker network and hate it now ...

This works but static ip "192.168.178.2" given by docker NOT by my dhcp

docker network create \
  -d macvlan \
  --subnet=192.168.178.0/24 \
  --gateway=192.168.178.1 \
  -o parent=wlo1
   pub_net

sudo docker run \
  --net pub_net \
  -p 8060:8060/tcp \ 
  -p 1900:1900/udp \
  -v /opt/docker/EcpEmuServer/rules.xml:/app/EcpEmuServer-v0.3-linux_x64/rules.xml \
  ecpemuserver:v0.3

This doesnt work

docker network create \
  -d macvlan \
  --ipam-driver=dhcp \
  --subnet=192.168.178.0/24 \
  --gateway=192.168.178.1 \
  -o parent=wlo1
   pub_net

Error response from daemon: plugin "dhcp" not found
marcolino7 commented 3 months ago

hi @erdoking , here is my version: https://github.com/marcolino7/docker-ecpemuserver I prefer to use debian as container OS. I used macvlan in the past but always with a static IP, and my suggestion is to use a static ip for EcpEmuServer, I am not sure that Roku client make a discover for IP every time, and in case ip change, your remote will stop to working

Marco