Docker

From Sundtek Wiki
Revision as of 08:39, 24 November 2020 by Sundtek (talk | contribs) (Created page with "== Docker == If you want to install the linux driver in a docker environment a few things need to be taken care of. In this example a tvheadend Docker is installed on a Synol...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Docker

If you want to install the linux driver in a docker environment a few things need to be taken care of. In this example a tvheadend Docker is installed on a Synology NAS:

The docker itself needs to be created with some -device flags

docker create --name alpinelinux 
                     --net=bridge 
                     -p 9981:9981 
                     -p 9982:9982 
                     --device=/dev/dvb 
                     --device=/dev/bus/usb 
                     -t alpine /bin/sh 

Very important /dev/bus/usb because this contains the interface to the raw USB devices which is used by the sundtek driver. However one special (and a little bit messy part of docker is that it also needs to know the major/minor IDs which are allowed to be forwarded, that's why /dev/dvb needs to be pre-created on the host as dummy files.

The driver on the host should have a configuration file which contains following text: enabledocker=on

this will cause that the driver on the native host (not in the docker) will create dummy adapter nodes in /dev/dvb, the driver itself will not try to access the USB device - it will only create the files if enabledocker=on is set in the configuration file.

Inside the docker

Inside the docker unfortunately you only have one shot if you do it wrong you have to re-create the docker and re-do this step. Usually our customers install the drivers inside the docker in /config

Download the netinstall script:

wget http://sundtek.de/media/sundtek_netinst.sh
chmod 777 sundtek_netinst.sh
./sundtek_netinst.sh -docker -use-custom-path /config

The installer will rename the tvheadend binary in /usr/bin to tvheadend.bin and places a script instead which will automatically start the driver.

this will place the driver in /config

Usually you will want to mount a local directory inside the docker, this can basically be configured via the Synology Webfrontend. When doing that you need to take care that the user inside the docker also has access to that folder otherwise you will get a permission denied.

You can use the tvheadend start script to change the permissions if you need that, /usr/bin/tvheadend add chmod 777 /path/to/videodirectory

Misc

one customer also needed to modify the preset current limit of the tuner, he had to place lnblimit=1000ma (case sensitive in sundtek.conf inside the docker)