Clipsal Cgate - Docker Container Image

Discussion in 'C-Gate Developers' started by poldim, Oct 5, 2018.

  1. poldim

    poldim

    Joined:
    Dec 7, 2010
    Messages:
    160
    Likes Received:
    0
    Location:
    San Francisco, CA
    I've seen a few people mention they'd like this but haven't seen anyone successfully doing this. Can anyone advise if they have gotten this working and what it took to get it up and running?

    My ideal setup is a docker host running cgate in one docket and a cgate to MQTT bridge in another docker so that I can control it all from within my Home Assistant (also in a docker) interface.

    @DarylMc
    @Robert
    @MadDude
    @simonhac
    @NickD
     
    poldim, Oct 5, 2018
    #1
    1. Advertisements

  2. poldim

    DarylMc

    Joined:
    Mar 24, 2006
    Messages:
    1,089
    Likes Received:
    12
    Location:
    Brisbane, QLD, Australia
    I haven't ever used docker.
    In the next few months I'm going to try a new image on raspian stretch lite.
    Following these updated instructions to use systemd
    https://blog.addictedtopi.com/2017/05/21/installing-c-gate-on-a-raspberry-pi/
     
    DarylMc, Oct 5, 2018
    #2
    1. Advertisements

  3. poldim

    OxleyDave

    Joined:
    Jan 13, 2007
    Messages:
    17
    Likes Received:
    0
    In case you haven't got anywhere with this yet or for anyone else this is what I've been using for the Dockerfile.
    Code:
    FROM arm32v7/openjdk:11.0.1-jre
    
    ENV APP_PATH=/cgate
    
    COPY cgate $APP_PATH
    COPY yourproject.xml $APP_PATH/tag/
    COPY access.txt $APP_PATH/config/
    
    EXPOSE 20023
    EXPOSE 20024
    EXPOSE 20025
    EXPOSE 20026
    EXPOSE 20123
    
    WORKDIR $APP_PATH
    CMD ["java", "-jar", "cgate.jar"]
    Build it like this:
    Code:
    curl -O https://updates.clipsal.com/ClipsalSoftwareDownload/mainsite/cis/technical/CGate/cgate-2.11.4_3251.zip && \
        unzip cgate-2.11.4_3251.zip && \
        rm -f cgate-2.11.4_3251.zip && \
        rm -f cgate/tag/* && \
        docker build -t cgate:arm-1 -f Dockerfile.arm .
    And run it like this:
    Code:
    docker create network cgate
    docker run -d --restart unless-stopped --network cgate -p 20023:20023 \
        -p 20024:20024 \
        -p 20025:20025 \
        -p 20123:20123 \
        --name cgate2 \
        cgate:arm-1
    You'll need the docker subnet in your access.txt. So something like this:
    Code:
    ##C-Gate Server Access Control File
    ## This file was written automatically by a command issued to the server
    ## Created:Tue Oct 05 16:22:26 CST 2004
    ## File name: C:\clipsal\c-gate\config\access.txt
    interface 0:0:0:0:0:0:0:1 Program
    interface 127.0.0.1 Program
    interface localhost Program
    interface 192.168.1.255 Program
    interface 172.18.255.255 Program
    ## End of access control file
    By not running any commands in the Dockerfile you can build this on your laptop and run it on the pi.
     
    OxleyDave, Jun 15, 2019
    #3
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.