PredatH0r / ChanSort

TV channel list editor for Samsung, LG, Sony, Hisense, Panasonic, Philips, Sharp, Toshiba and MANY more.
842 stars 115 forks source link

add docker support (example included) #285

Open grrvs opened 2 years ago

grrvs commented 2 years ago

Hi there, I just tried to run chansort in docker.

This is the Dockerfile:

FROM scottyhardy/docker-wine:latest
ARG CHANSORT_RELEASE="2021-10-24"
RUN xvfb-run winetricks -q dotnet48
RUN mkdir /app
RUN wget https://github.com/PredatH0r/ChanSort/releases/download/v${CHANSORT_RELEASE}/ChanSort_${CHANSORT_RELEASE}.zip -O /tmp/ChanSort_${CHANSORT_RELEASE}.zip
RUN unzip /tmp/ChanSort_${CHANSORT_RELEASE}.zip -d /app/
RUN rm -rf /tmp/ChanSort_*
ENV RUN_AS_ROOT=yes
WORKDIR /app/ChanSort_${CHANSORT_RELEASE}/
ENTRYPOINT ["/usr/bin/entrypoint", "wine", "ChanSort.exe"] 

And this is how I build and run (on ubuntu focal):

# build the image
docker build . -t chansort:latest

# run the container - please don't forget to update /path/to/channel_list wherever
docker run -it \
  --rm \
  --hostname="$(hostname)" \
  --env="DISPLAY" \
  --volume="${XAUTHORITY:-${HOME}/.Xauthority}:/root/.Xauthority:ro" \
  --volume="/tmp/.X11-unix:/tmp/.X11-unix:ro" \
  --volume="/path/to/channel_list:/data" \
  chansort:latest

Instructions were taken straight from scottyhardy/docker-wine.

Chansort is starting and I am able to edit and save a channel list but I did not test that list on a TV (yet).

baztian commented 1 year ago

Thanks for the instructions. For me it failed installing dotnet

76.74 warning: dotnet40 install completed, but installed file /root/.wine/dosdevices/c:/windows/Microsoft.NET/Framework/v4.0.30319/ngen.exe not found
76.74 ------------------------------------------------------
------
Dockerfile:3
--------------------
   1 |     FROM scottyhardy/docker-wine:latest
   2 |     ARG CHANSORT_RELEASE="2023-06-01"
   3 | >>> RUN xvfb-run winetricks -q dotnet48
   4 |     RUN mkdir /app
   5 |     RUN wget https://github.com/PredatH0r/ChanSort/releases/download/v${CHANSORT_RELEASE}/ChanSort_${CHANSORT_RELEASE}.zip -O /tmp/ChanSort_${CHANSORT_RELEASE}.zip
--------------------
ERROR: failed to solve: process "/bin/sh -c xvfb-run winetricks -q dotnet48" did not complete successfully: exit code: 1
baztian commented 1 year ago

I was able to resolve the issue by going back to an older wine release

FROM scottyhardy/docker-wine:stable-7.0
ARG CHANSORT_RELEASE="2023-06-01"
RUN xvfb-run winetricks -q dotnet48
RUN mkdir /app
RUN wget https://github.com/PredatH0r/ChanSort/releases/download/v${CHANSORT_RELEASE}/ChanSort_${CHANSORT_RELEASE}.zip -O /tmp/ChanSort_${CHANSORT_RELEASE}.zip
RUN unzip /tmp/ChanSort_${CHANSORT_RELEASE}.zip -d /app/
RUN rm -rf /tmp/ChanSort_*
ENV RUN_AS_ROOT=yes
WORKDIR /app/ChanSort_${CHANSORT_RELEASE}/
ENTRYPOINT ["/usr/bin/entrypoint", "wine", "ChanSort.exe"]
baztian commented 1 year ago

also I needed to add --ipc host command line flag to docker run command