monocle-gateway: No such file or directory



  • Hello,

    I tried to install monocle into an alpine linux by:

    # ---------------------------------------
    # Create Monocle Gateway configuration 
    # directory
    # ---------------------------------------
    RUN mkdir -p /etc/monocle
    RUN mkdir -p /share/monocle
    RUN mkdir -p /tmp/monocle
    RUN ls -s /etc/monocle /share/monocle
    
    
    # ---------------------------------------
    # Install Monocle Gateway dependencies
    # and other useful utilties
    # ---------------------------------------
    RUN apk update &&      \
        apk add --no-cache \
        wget               \
        curl               \
        libstdc++          \
        nano               \
        net-tools          \
        openssl            \
        ca-certificates
    
    # ---------------------------------------
    # Download versioned Monocle Gateway
    # build archive file
    # - - - - - - - - - - - - - - - - - - - -
    # Extract Moncole Gateway related 
    # executables to the appropriate 
    # runtime directories 
    # - - - - - - - - - - - - - - - - - - - -
    # Remove the downloaded Monocle Gateway 
    # archive files
    # ---------------------------------------
    RUN wget -c https://files.monoclecam.com/monocle-gateway/linux/monocle-gateway-linux-armv7-v0.0.4.tar.gz -O /tmp/monocle/monocle-gateway.tar.gz && \
        cd /usr/local/bin/ && \
        tar xvzf /tmp/monocle/monocle-gateway.tar.gz monocle-gateway && \ 
        tar xvzf /tmp/monocle/monocle-gateway.tar.gz monocle-proxy  && \
        rm -Rf /tmp/monocle/
    
    # ---------------------------------------
    # Expose required TCP ports 
    # (port 443 is required by Amazon for 
    # secure connectivity)
    # ---------------------------------------
    EXPOSE 443/tcp
    
    # ---------------------------------------
    # Expose required UDP ports 
    # (used for the @proxy method to allow 
    # IP cameras to transmit streams via UDP)
    # ---------------------------------------
    EXPOSE 62000-62100/udp
    
    COPY run.sh /run.sh
    RUN chmod +x /run.sh
    ENTRYPOINT ["/bin/bash", "-c", "/run.sh"]
    

    If I try to run by

    #!/bin/bash
    /usr/local/bin/monocle-gateway --tail
    

    I get monocle-gateway: No such file or directory - Where is my mistake or can anyone confirm that?

    Thanks, Thomas



  • @tringler

    We have a Docker image pre-built (based on Alpine) it you want to use it.

    And here is our Dockerfile:
    https://github.com/MonocleCam/monocle-gateway-docker/blob/master/Dockerfile


    Just doing a cursory comparison, I think the TAR.GZ you are downloading is not compiled for Alpine but rather Debian/Ubuntu distros.
    monocle-gateway-linux-armv7-v0.0.4.tar.gz

    Our Docker file is pulling this archive instead: “monocle-gateway-alpine-x64-0.0.4.tar.gz” – (for x64 rather than ARM. however)

    Thanks, Robert



  • It looks like we are currently only building “x64” binaries for Alpine distros.

    -Robert



  • Thanks! Understood. Would it be possible to compile it for other architectures as well for alpine or should I use the linux binaries with i.e. an ubuntu base image? It is even possible to compile it by my own?

    For my use case I need to build my own Docker images to use it as hass.io plugin - Repo:
    https://community.home-assistant.io/t/add-monocle-gateway-as-add-on/146075

    Use-case:
    https://developers.home-assistant.io/docs/en/hassio_addon_tutorial.html

    Regards, Thomas



  • @tringler

    The binaries are not currently open source and the build can be a bit complicated/convoluted. However, I’d be happy to try and help and get distributions compiled for whatever platforms/distributions are needed for hass.io.

    Looking at the arch property of config.json example on this page: https://developers.home-assistant.io/docs/en/hassio_addon_tutorial.html

    "arch": ["armhf", "armv7", "aarch64", "amd64", "i386"],

    So maybe we need Alpine images for at least “i386”, “armv7” and “aarch64”?
    “armhf” is pretty old at this point and I’m not sure if we can compile for that or would want to add support for it.

    The tricky part for any Docker instance is the networking. The Monocle Gateway must be able to listen on port 443 and must be able to access the IP cameras on the user’s private network.
    (see Networking Considerations: https://hub.docker.com/r/monoclecam/monocle-gateway)


    Before we move forward on all that work, lets make sure we can get it fully working as a hass.io plugin/add-on first. So, like you suggested, lets just start with an “Ubuntu” base image in the Docker image for the add-on. The “apk” commands will have to be replaced with “apt” for ubuntu. But the rest looks like it should work for an Ubuntu docker image.

    Thanks, Robert



  • Thanks for your support! I will try it with Ubuntu on armv7 architecture and host networking. If its working I can improve it by switching the base image to alpine and/or try it with bridge networking.



  • @tringler

    Let me know how it goes. I’ve started the process to get the underlying binaries compiling for Alpine for the various ARM builds. Still a work in progress …

    Thanks, Robert



  • @Monocle

    Hi Robert,

    have you compiled Alpine binaries for the various ARM builds?

    I’m also interested in Hassio addon developement…

    Bye
    SDeSalve


Log in to reply