Synology Docker setup: network_mode and ports invalid yaml config, no remote access

I migrated my Channels setup from a Mac Mini (native macOS install) to a Synology DS920+ running in a Docker container tonight and I can't get remote access working. The official docker instructions say to add both network_mode: host and ports in the docker-compose configuration, but docker-compose doesn't accept that.

docker.errors.InvalidArgument: "host" network_mode is incompatible with port_bindings
[1359] Failed to execute script docker-compose

This is my current yaml:

version: "3.8"
services:
  channels-dvr:
    image: fancybits/channels-dvr:tve
    container_name: channels-dvr
    network_mode: host
    # official docs say to have ports, but it is not compatible with network_mode: host
    # ports:
    #   - "8089:8089"

    restart: on-failure:10
    # could also try one of these:
    # restart: always
    # restart: unless-stopped
        
    environment:
      - PUID=xxxx
      - PGID=xxx
      - TZ=America/New_York
    volumes:
      - /volume1/docker/channels-dvr:/channels-dvr
      - /volume1/docker/channels-dvr/dvr:/dvr
    devices:
      - /dev/dri:/dev/dri

(PUID and PGID are set with the correct values in the real file)

This is the docker-compose version info from the default Docker package offered by Synology:

$ docker-compose --version
docker-compose version 1.28.5, build 24fb474e

Everything seems to work fine at home, but remote access does not work. I get the "Your Channels DVR Server at home can not be reached. Remote Access is enabled, but we can not reach your server" error. The port has been forwarded from my router to my NAS. I assume the issue is with the port not being in the yaml, but I'm not sure how to get it working.

It needs to run in bridged mode, not host mode.

I'll give that a try. Does Bonjour still work? This is what the official doc says:

The `--net=host` option is required for the Channels apps to discovery your DVR via Bonjour.

No Bonjour doesn't. You have to specify the host IP to connect to it from a client.
I don't use a compose file, I use the docker run command on my two Synologys.

You might want to change that second one so it records to a Shared Folder on your Synology.

Here; what I did and one of my run commands as an example.

create directory for Channels DVR config/code
/volume1/docker/channels-dvr
create Shared Folder for Channels DVR recordings
/volume1/chDVRhdhr

pull image fancybits/channels-dvr:latest
docker pull fancybits/channels-dvr:latest

docker run \
 --detach \
 --env TZ=America/Los_Angeles \
 --name=channels-dvr-hdhr \
 -p 8089:8089/tcp \
 --restart=unless-stopped \
 --device /dev/dri:/dev/dri \
 --volume /volume1/docker/channels-dvr:/channels-dvr \
 --volume /volume1/chDVRhdhr:/shares/dvr \
 fancybits/channels-dvr:latest

For anyone who finds this thread:

any version of docker-compose v1.28.0 or higher is subject to throwing these error messages if you specify BOTH “network_mode: host” and “ports:”

My guess is the official docker instructions were based off an earlier version of docker-compose

Note
Given that the container does not have its own IP-address when using host mode networking, port-mapping does not take effect, and the -p, --publish, -P, and --publish-all option are ignored, producing a warning instead:

I made this change and now it can't see my HD Homerun tuner... any ideas?

version: "3.8"
services:
  channels-dvr:
    # image: timstephens24/channels-dvr:latest
    image: fancybits/channels-dvr:tve
    container_name: channels-dvr
    
    # you cannot specify "host" and ports not allowed, default is "bridge"
    # network_mode: host
    ports:
      - "8089:8089"
    # hostname: channels
    # restart: always
    restart: on-failure:10
        
    environment:
      - PUID=xxxx
      - PGID=xxx
      - TZ=America/New_York
    volumes:
      - /volume1/docker/channels-dvr:/channels-dvr
      - /volume1/docker/channels-dvr/dvr:/dvr
    devices:
      - /dev/dri:/dev/dri

You have to use the IP address of your HDHR tuners to use them when running in a container with bridge networking since broadcasts won't be seen from inside the container.

+ Add Source > HDHomeRun Device and enter the IP address of it.

You may want to consider using the built-in Tailscale integration in Channels DVR server and clients.
I run 4 Channels DVR servers in containers at home and can access any of them remotely using their Tailnet IP addresses.

So, after running it once with the port and bridge mode, remote access has “stuck” and still works even after going back to “host” from bridge. I’ll watch it for a couple days and see if it keeps working.

Just curious - Why run 4 separate servers?

Don't want to derail this topic. Because I can and 3 are not enough, 5 are too many. I have posts scattered about the forum explaining why.

1 Like

I mean, you could have just answered the question. That derailment would have been no more derailing than the response you did give.

I derailed 10 minutes looking for your posts that are scattered about the forum and only found where you said exactly the same thing:

But whatever. It was just a simple question because I was curious what the use case is.

*** End of obtrusive derailment ***

I just wanted to add to this topic that I also had to remove the network_mode: host in my docker-compose file for my docker setup to work.

I installed the channels-dvr in an Alpine Linux OS and for hours I have been trying to figure out why I was getting that error message.

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.