Docker Implementation

Docker, according to Wikipedia is a set of platform as a service products that use OS-level virtualization to deliver software in packages called containers. Containers are isolated from one another and bundle their own software, libraries and configuration files; they can communicate with each other through well-defined channels.

My source found in Github has been built to create Docker images allowing for the deployment on any platform, relatively easily. Each of the components, with the exception of the RFID sensor is available as a separate Docker images.

To do so one must first install Docker, the instructions on how to do that for Windows, Linux and Mac can be found on the Docker site as follows:

  • Macintosh
  • Linux this is for the Centos distribution but others can be found in the index on the left side of the page
  • Windows

Once Docker has been installed and is working the high level installation process is outlined here, but detailed in a document:

  • As Docker images do not have internal storage space Docker volumes for mosquitto, myRailsDb, and myRailsImages need to be created using the following commands:
    • docker volume create –name mosquitto
    • docker volume create –name myRailsDb
    • docker volume create –name myRailsImages
  • To add images to your local Docker repository and convert them into executing containers using the following commands:
    • docker run –name myMongo -v myRailsDb:/data/db -p 27017:27017 -d mongo
    • docker run –link=myMongo:mongodb -p 3000:3000 –name myRids -d dbristow/rids
    • docker run –link=myMongo:mongodb -p 3006:3006 –name myRlds -d dbristow/rlds
    • docker run –link=myMongo:mongodb -p 3007:3007 –name myPpds -d dbristow/ppds
    • docker run -it –name myMqttBrkr -p 1883:1883 -p 9001:9001 -v myMqttBrkr:/mosquitto -d eclipse-mosquitto
    • docker run -e ‘RSRM_TCP_PORT=3002’ –link=myMqttBrkr:mqtt -p 3005:3005 –name myIsrs -d dbristow/isrs
    • docker run –link=myMqttBrkr:mqtt –link=myRlds:rlds –name myIsms -d dbristow/isms
    • docker run -e ‘MRLM_TCP_PORT=3004’ –link=myMqttBrkr:mqtt -p 3010:3010 –name myIsts -d dbristow/ists
    • docker run -e ‘MRLM_TCP_PORT=3004’ –link=myMqttBrkr:mqtt -p 3012:3012 –name myIsbs -d dbristow/isbs
    • docker run –link=myMqttBrkr:mqtt -p 3011:3011 –name myIpts -d dbristow/ipts
    • docker run –link=myMqttBrkr:mqtt -p 3013:3013 –name myIpls -d dbristow/ipls
    • docker run -e ‘MRFM_TCP_PORT=3030’ –name myMrfm -v myRailsImages:/usr/djb/src/uploads -p 3030:3030 -d dbristow/mrfm
    • docker run –link=myRids:rids –link=myIsrs:isrs -p 3002:8080 –name myRsrm -d dbristow/rsrm
    • docker run –link=myRids:rids –link=myMrfm:mrfm -v myRailsImages:/usr/djb/dist/static/img -p 3001:8080 –name myMrim -d dbristow/mrim
    • docker run –link=myPpds:ppds -p 3008:8080 –name myMppm -d dbristow/mppm
    • docker run –link=myRlds:rlds -p 3004:8080 –name myMrlm -d dbristow/mrlm
  • Finally the four Managers can be launched in your browser:
    • Model Railroad Inventory Manager http://localhost:3001
    • Rolling Stock RFID Manager http://localhost:3002
    • Model Projects and Purchases Manager http://localhost:3004
    • Model Railroad Layout Manager http://localhost:3008