Using Synology Surveillance Station and Docker



  • That information is very helpful, but I have been messing around trying to create the macvlan network driver in the docker CLI, but I don’t have the process correct to build the container.
    I tried the docker network create commands, but it does not add the driver. Is it possible to just edit the .yml file and upload it to the NAS? I can do this, I just do not know where the file would be located.

    Could you do a “find . -name docker-compose.yml” to show the correct directory?

    This is my configuration:

    version: '2'
    
    services:
    
      monocle-gateway:
        container_name: monocle-gateway
        hostname: monocle-gateway
        image: monoclecam/monocle-gateway
        restart: always
        volumes:
          - /etc/monocle:/etc/monocle:/docker/etc/monocle
        networks:
          monocle-gateway-network:
            ipv4_address: 192.168.0.229
           
    networks:
    
      monocle-gateway-network:
        driver: macvlan
        driver_opts:
          parent: bond0
        ipam:
          config:
            - subnet: 192.168.0.0/24
              gateway: 192.168.0.1
    

    Also, I mounted a similar share to the monocle container, but it is using the token from this file path:

    ./volume4/@docker/btrfs/subvolumes/cab8b1faf476e6d419cdd62c4bcd6b3ee949f461ef6a349963ab14e8223b250e/etc/monocle/monocle.token

    Hopefully I can figure this all out. I would also be interested if you have a contribution page to help development.



  • @burkminipup

    Here is where my docker compose file exists.

    04578304-79f2-415f-b719-917d5397ca73-image.png

    Its in the same “monocle” shared folder located on “Volume 1” as my monocle.token file.



  • After about the 5th time, I got it created with this syntax:

    docker network create -d macvlan --subnet=192.168.0.0/24 --gateway=192.168.0.1 -o parent=bond0 monocle-network

    Now do I need to upload the .yml file separately? I have already assigned it through GUI.

    Monocle-Network.PNG



  • @Monocle

    I could not get Monocle to use that directory for my token. I will just put the .yml in the same directory that my token is currently working in.



  • @burkminipup

    I just copied the docker-compose.yml file to my “monocle” shared folder, then from the command line I used the docker-compose tool with the -up argument. Something like this:

    docker-compose up -d ./docker-compose.yml
    

    see: https://docs.docker.com/compose/reference/up/



  • @burkminipup

    The docker-compose will auto create the container and network stack, you should not have to manually create the macvlan network.



  • @burkminipup

    I’m not sure this is correct in your docker-compose yml.

        volumes:
              - /etc/monocle:/etc/monocle:/docker/etc/monocle
    

    Mine is:

    • /volume1/monocle:/etc/monocle

    This means /volume1/monocle on the NAS gets mounted as /etc/monocle inside the running container.
    This allows us to store the monocle.token file and any other config outside of the container and allow you to stop and start/destroy/rebuild your container without losing any config.



  • @burkminipup

    FYI, I am logged in via SSH using an “admin” level access account on the NAS.



  • @burkminipup said in Using Synology Surveillance Station and Docker:

    I could not get Monocle to use that directory for my token. I will just put the .yml in the same directory that my token is currently working in.

    I don’t think it matters where “docker-compose.yml” exists. Monocle-Gateway does not use this file. So no need for it inside the container.
    You can put it anywhere on your NAS so long as you can access it via the SSH terminal to your NAS. Then just use the docker-compose executable to load this docker-compose.yml config file. This will make Docker build the container and networking stack.



  • @Monocle

    When you said:

    • ipv4_address is the STATIC IP address I want to manually assign to the gateway. (Note: this address should be reserved or outside the DHCP range of your network router.)

    Are you creating an IP address for the gateway? I have my IP address outside my DHCP pool, but I want to confirm that this is not supposed to be the NAS IP address. I have the gateway of the macvlan set to my router.

    Another thing, would port-forwarding help allow my streams to make a connection? I can get the Monocle RTSP server running, but have not had luck with the connection. Also, after the connection fails, then Monocle goes into a disconnect loop.

    Monocle-Network Disconnect.JPG

    I am going to also try with a non Synology RTSP setup when I get home.

    Thanks again.



  • @burkminipup said in Using Synology Surveillance Station and Docker:

    @Monocle
    When you said:

    ipv4_address is the STATIC IP address I want to manually assign to the gateway. (Note: this address should be reserved or outside the DHCP range of your network router.)

    Are you creating an IP addres

    It’s an IP address that gets assigned to the Monocle Gateway instance running as a Docker container. Its an IP address that is valid on your existing private LAN, but one that is outside your DHCP range so that you don’t end up with two nodes on the network competing for the same address.

    The errors you posted are acting like the Monocle Gateway cannot access the Internet or possibly does not have a valid DNS server to resolve the hostname for the Monocle API server.

    I don’t think any port forwarding is required.

    I am going to also try with a non Synology RTSP setup when I get home.

    I agree, lets get it working here first before complicating the setup with a Docker container running on the Synology.

    Thanks, Robert



  • How To Install Monocle Gateway on a Synology NAS as a Docker Container

    How To Install Monocle Gateway on a Synology NAS as a Docker Container
    Article:
    https://monoclecam.com/monocle-gateway/install/synology


Log in to reply