Public Repository

Last pushed: 3 months ago
Short Description
compose an appliance from a json file
Full Description

Target

  • Raspberry pi 3
  • Raspberry pi 2
  • Raspberry pi 1
  • Raspberry pi 0
  • Raspberry pi 0 w

Prerequisites

The docker remote API should be enabled

Use

docker run -it --rm -v /var/run/docker.sock:/var/run/docker.sock -v /root/hydra_compose/config.json:/config.json digitalairways/hydra_compose:0.0.1 -config /config.json -verbose

Options

  • -clear clear unused images
  • -config string the path of config file for composing
  • -lc list the docker's containers
  • -li list the docker's images
  • -r restart containers when composing
  • -v display version
  • -verbose enable verbose

Structure for the json file :

{
    "name":  "myComposeName",
    "version": "X.X.X",
    "images":[
        {
            "name": "container_mosquitto",
            "config": {
                "Image": "pascaldevink/rpi-mosquitto:1.0",
                "ExposedPorts": {
                    "1883/tcp": {},
                    "9001/tcp": {}
                }
            },
            "host_config": {
                "PortBindings": {
                    "1883/tcp": [{
                        "HostPort": "1883"
                    }],
                    "9001/tcp": [{
                        "HostPort": "9001"
                    }]
                },
                "RestartPolicy": {
                    "Name": "always"
                }
            }
        },
        {
             "name":"container_1",
             "servers": [{"url": "docker.io", "token": "myToken"}],
             "config": {
                 // see below
             },
             "host_config": 
                 // see below
             },
             "net_config": {
                 // see below
             },
             "script": "curl mythingbox.io/api/docker/container_1/config | sh"
        }
    ],
    "brokers": [{"ip": "localMQTT", "port": "1883"}],
    "config_servers": ["mythingbox.io/api/config/byNFC"]
}

config
host_config
net_config

Docker Pull Command
Owner
digitalairways

Comments (0)