Hilscher Forum
Launching multi-containers at a time - Docker stacks - Printable Version

+- Hilscher Forum (https://forum.hilscher.com)
+-- Forum: netPI - Ruggedized Raspberry Pi with Industrial Ethernet (https://forum.hilscher.com/Forum-netPI-Ruggedized-Raspberry-Pi-with-Industrial-Ethernet)
+--- Forum: Software (https://forum.hilscher.com/Forum-Software)
+--- Thread: Launching multi-containers at a time - Docker stacks (/Thread-Launching-multi-containers-at-a-time-Docker-stacks)

Launching multi-containers at a time - Docker stacks - Armin@netPI - June-4th-2019

The official  Docker Compose definition is: "A tool for defining and running multi-container Docker applications". The good news is: Docker composing is featured by netPI as well using the Docker stacks feature that doesn't need to have the docker-compose function installed. Lean more here about the difference between both.

For that use netPI's Docker web GUI portainer.io and its menu item "Stacks" to compose. Click "+Add stack" and check the "Web editor" feature and copy and paste the content of your compose YAML file into the web editor window. Finally click "Deploy the stack".

Since Docker compose often starts many containers at a time you have to patiently wait for downloading the container images the first time you use this function.

Here is how a typical compose file content looks like:

version: "2"
   image: hilschernetpi/netpi-codesys-basis:latest
   network_mode: "host"
   restart: always
     - "/dev/vcio:/dev/vcio"
   privileged: true
   image: nodered/node-red-docker:rpi
     - "1880:1880"
     - bridgeNetwork
   restart: always
   user: root
   image: influxdb
   restart: always
     - "8086:8086"
     - bridgeNetwork
     - INFLUXDB_DB=db0
     - INFLUXDB_USER=user
   image: grafana/grafana
   restart: always
     - "3000:3000"
     - bridgeNetwork
       driver: bridge
           driver: default
               - subnet:
The example above configures and starts 4 containers in a single step:
  • Grafana graphical tool
  • Node-RED IoT tool
  • InfluxDB database
netPI  today supports the compose file reference version 2.x. Find here the compose file reference. The version is usually the first statement in a compose file.