Channels DVR on docker

So I decided to take the plunge and play with Docker.
I would like to add a Channels DVR docker container to my Synology NAS that is currently running Channels DVR as a Synology package.
Only doing this to play with and learn docker, so I don't need to migrate anything or worry about test settings/recordings.

Have a few questions regarding setup and configuration.

  1. Can I install the Channels DVR docker container to play with and still use the existing Synology package Channels DVR to keep recording my passes ?

Regarding https://getchannels.com/dvr-server/#docker instructions
I'll be changing the image to fancybits/channels-dvr:tve

  1. If I add '-p 192.168.1.3:8189:8089/tcp' to the run command will I then be able to access the containers Channels DVR web UI via http://192.168.1.3:8189 ?

Documentation at docker.com is unclear on --volume /mnt/disk/dvr/recordings:/shares/DVR

  1. Where will my recordings be if I ssh into my NAS and use ls, /mnt/disk/dvr/recordings or /shares/DVR ? I'd like them to go to one of my shared folders.
1 Like

You've got the overall gist of it. As far as where your recordings are, it will be the former. The latter/second path you indicate is where the container sees the files, while the former is where they actually exist. (Docker employs an overlay filesystem to map host directories into the container.)

You can probably forgo the specificities in the port mapping: -p 8189:8089 ought to be sufficient.

1 Like

Thanks.
The NAS has 4 network interfaces, so I wanted to bind it only to LAN1 at 192.168.1.3 and figured that was the way to do it.

re: --volume Does it have to be /mnt/disk/dvr/ or could I specifiy my shared volume /volume1/

1 Like

Not sure how permissions are working with Syno and Docker. In theory, yes.

As far as the IP/interface restriction, I believe that's correct.

1 Like

Arghhhh.. Can't use the options I need using the Synology Docker Manager and can't get the docker cli to work either.

# docker run --detach --name=channels-dvr-tve --env TZ=America/Los_Angeles --net=host -p 192.168.1.3:8189:8089/tcp --restart=on-failure:10 --device /dev/dri:/dev/dri --volume /mnt/disk/dvr/config:/channels-dvr --volume /volume1/arkives/ChDockerDVR:/shares/DVR fancybits/channels-dvr:tve

WARNING: Published ports are discarded when using host network mode 980b6ff8baddf25313800bdd63af55a5d2fd0e25cc8ab3d6f26bf94f059441ba docker: Error response from daemon: linux runtime spec devices: error gathering device information while adding custom device "/dev/dri": no such file or directory.

# docker run --detach --name=channels-dvr-tve --env TZ=America/Los_Angeles --net=host -p 192.168.1.3:8189:8089/tcp --restart=on-failure:10 --volume /mnt/disk/dvr/config:/channels-dvr --volume volume1/arkives/ChDockerDVR:/shares/DVR fancybits/channels-dvr:tve

WARNING: Published ports are discarded when using host network mode e6eeba8d9ae2e9cdea3d802029465aa6ce89cc786d9d89c009f75ec0befe46f7 docker: Error response from daemon: Bind mount failed: '/mnt/disk/dvr/config' does not exists.

# ls -adlh /mnt
drwxr-xr-x 2 root root 4.0K May 11  2020 /mnt

# stat /mnt
File: '/mnt'
Size: 4096            Blocks: 8          IO Block: 4096   directory
Device: 900h/2304d      Inode: 953         Links: 2
Access: (0755/drwxr-xr-x)  Uid: (    0/    root)   Gid: (    0/    root)
Access: 2021-01-17 18:42:46.582813746 -0800
Modify: 2020-05-11 15:18:22.000000000 -0700
Change: 2020-05-26 13:19:20.632000436 -0700
 Birth: -

Well, a couple of things stand out:

Does your NAS support hardware decoding, and does it in fact have a /dev/dri directory?

It looks like your /mnt directory does not contain the disk/dvr/config directory you claim it does.

You can't mount (even an overlay/bind mount) a source directory that does not exist.

No, figured that out after the fail and did the run again without that.

Yep, here's where I need to figure out what's wrong with what instructions.
Docker docs say it will create the directory.
Synology docs are lacking and confusing.

If it doesn't have to be in the /mnt directory I can put it in my shared folder instead.
More reading to do.

Start up Channels DVR Server via Docker:

docker run \
  --detach \
  --name=channels-dvr \
  --net=host \
  --restart=on-failure:10 \
  --device /dev/dri:/dev/dri \
  --volume /mnt/disk/dvr/config:/channels-dvr \
  --volume /mnt/disk/dvr/recordings:/shares/DVR \
  fancybits/channels-dvr:latest

Now I know the directories are just 'examples' I got it to work on my shared folder!

docker run --detach --name=channels-dvr-tve --env TZ=America/Los_Angeles --net=host -p 8189:8089/tcp --restart=on-failure:10 --volume /volume1/arkives/ChDockerDVR/config:/channels-dvr --volume /volume1/arkives/ChDockerDVR/recordings:/shares/DVR fancybits/channels-dvr:tve

That means Docker will create the directory in the container. However, this is contingent upon the source directory existing in the first place.

If you want to save your config data in /srv/channels/data, and you want to expose it to the container at the path /1/2/3/channels-dvr/config/, then you would need to create and have existing the /srv/channels/data directory, and then you could add … -v /srv/channels/data:/1/2/3/channels-dvr/config …, and Docker will ensure that the parent directories for /1/2/3/channels-dvr are created in the container, even if they don't exist in the container image you downloaded.

My victory was short lived.
I got it to run, but it's not listening on port 8189:8089 like I asked it to.
At least I'm to the point I can view the Channels DVR log file.

2021/01/17 19:55:35.267369 [SYS] Starting Channels DVR v2021.01.15.1649 (linux-x86_64 pid:1) in /channels-dvr/data
2021/01/17 19:55:35.361271 [ERR] Could not start server: listen tcp :8089: bind: address already in use
2021/01/17 19:55:35.847494 [HDR] Found 1 devices
2021/01/17 19:55:35.870044 [ERR] Failed to refresh auth: missing oauth client
2021/01/17 20:04:36.932201 [SYS] Shutting down...
2021/01/17 20:04:37.933503 [SYS] Goodbye.

Getting there...

This got it running and I can view the Channels DVR welcome page but it has no Internet connection as it looks to be running on the docker bridge network 172.17.0.0/16
docker run --detach --name=channels-dvr-tve --env TZ=America/Los_Angeles -p 8189:8089/tcp --restart=on-failure:10 --volume /volume1/arkives/ChDockerDVR/config:/channels-dvr --volume /volume1/arkives/ChDockerDVR/recordings:/shares/DVR fancybits/channels-dvr:tve

2021/01/17 20:10:52.209763 [SYS] Starting Channels DVR v2021.01.15.1649 (linux-x86_64 pid:1) in /channels-dvr/data
2021/01/17 20:10:56.058760 [SYS] Started HTTP Server
2021/01/17 20:10:56.467602 [HDR] Found 0 devices
2021/01/17 20:10:56.522565 [ERR] Failed to refresh auth: missing oauth client
2021/01/17 20:10:56.524009 [SYS] Bonjour service running for dvr-0c6a55e07c2d.local. [172.17.0.2]

Ah, if you already have a Channels instance running, using host networking won't work, because both instances want to access the same port.

In your case, you need to either use macvlan networking, or bind to a different address/interface.

Hence my original questions 1 & 2.
I thought the docker container port mapping 8189:8089 would work.

You might have issues with host networking.

Docker is a bit of a clusterf* … Personally, I use Docker containers (which are OCI compliant by definition) with Podman, which is basically a drop-in Docker replacement with better security, good support for SELinux, and much less resource overhead.

So close. Guess I'll give up on this.
Unless I can configure a port number other than 8089 for Channels DVR.

Only externally with assistance from the devs. The server itself cannot attach to a different port. (You may be able to achieve this with routing domains ... but if containers are above your head, the messing with gateways and rdomains might be, too.)

Yeah, I just went from Dockers are a jean brand to dockers suck and don't do what I want. The blue whale is sinking.

You may want to brush up on your fashion. Dockers are a brand of chinos or work pants, but I have never seen a pair of Dockers made from denim.

You can remove this and it will use the port you specify.

Only on the docker bridge network 172.17.0.0/16 which cannot reach the Internet.

2021/01/17 20:10:56.524009 [SYS] Bonjour service running for dvr-0c6a55e07c2d.local. [172.17.0.2]

Yeah, the authentication needed for Channels does not work with bridge networks. You need to use a host or macvlan type of network.

It may be Synology's implementation in their Docker package.
I installed their latest version available.


Screenshot_2021-01-17 DS1513PLUS - Synology DiskStation

If I use either -p 192.168.1.3:8189:8089/tcp or -p 8189:8089/tcp without --net=host it uses the docker bridge network 172.17.0.0/16.
If I include --net=host -p 8189:8089/tcp the Synology Docker display shows the port binding for the container, but Channels DVR fails to start with error [ERR] Could not start server: listen tcp :8089: bind: address already in use