Sign inSign up

raildocker/railhome

By raildocker

•Updated over 1 year ago

Docker image to sync rpicd config files

Image
0

527

raildocker/railhome repository overview

This docker enables to sync private git repositories containing the config files of rpicd (rpicd.xml) and any other information you may need to run your configuration (config files from the control software interfacing rpicd).

To run it you can use:

version: '3'

services:
  railhome:
    container_name: railhome
    image: raildocker/railhome:arm7
    volumes:
      - config:/config
#First part should match the named volume at the end of the file,
#Second part (the docker part) should match the WORKDIR ENVRIRONMENT at the environment section
#This folder should be the same as the one set in rpicd as config folder.

      - /home/$USER/.ssh/id_rsa:/root/.ssh/id_rsa       #User launching the container must have previous access to the git repository
                                                                                  #See https://docs.gitlab.com/ee/ssh/ for more details
#Uncomment to run on x86 directories
      - /usr/bin/qemu-arm-static:/usr/bin/qemu-arm-static

    environment:
      - WORKDIR=/config      #It should match the mapping part of the docker (second part) in the volume define above
      - GITTRUSTHOST=gitlab.com                                #To generate the fingertprint on first run. It s recommendable to check the logs on the first run
      - GITURL=                                                              #To update with the git repository you want to sync
      - GITUSER=                                                          #user and mail for the git user
      - GITMAIL=
    restart: always
    stop_grace_period: 90s                                     

volumes:
  config:         #it should match the volume defines on top. 
     driver: local

The variables to be defined are GITTRUSTHOST, GITURL, GITUSER, GITMAIL, Note the stop_grace_period: 90s. When syncing with a git repository, it may take some time, and it is necessary that the docker service does not stop railhome before it finishes its task.

Currentñy railhome monitors the status of rpicd to see when it can start syncing. This is control with same sempahore files at WORKDIR. If you need to sync files from other control software, you may need to modify the entrypoint script to monitor new semaphore files - and be sure such control software generates the right fles (probably by creating your own init scripts.

If you need support with this part, just send me ane e-mail.

Tag summary

Content type

Image

Digest

sha256:d464576af…

Size

10.5 MB

Last updated

over 1 year ago

docker pull raildocker/railhome