• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Launching multi-containers at a time - Docker stacks
#1
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:

Code:
version: "2"
 
services:
 codesys:
   image: hilschernetpi/netpi-codesys-basis:latest
   network_mode: "host"
   restart: always
   devices:
     - "/dev/vcio:/dev/vcio"
   privileged: true
 
 nodered:
   image: nodered/node-red-docker:rpi
   ports:
     - "1880:1880"
   networks:
     - bridgeNetwork
   restart: always
   user: root
 
 influxdb:
   image: influxdb
   restart: always
   ports:
     - "8086:8086"
   networks:
     - bridgeNetwork
   environment:
     - INFLUXDB_DB=db0
     - INFLUXDB_ADMIN_ENABLED=true
     - INFLUXDB_ADMIN_USER=admin
     - INFLUXDB_ADMIN_PASSWORD=12345678
     - INFLUXDB_USER=user
     - INFLUXDB_USER_PASSWORD=12345678
 
 grafana:
   image: grafana/grafana
   restart: always
   ports:
     - "3000:3000"
   networks:
     - bridgeNetwork
 
networks:
   bridgeNetwork:
       driver: bridge
       ipam:
           driver: default
           config:
               - subnet: 172.30.0.0/24
                 gateway: 172.30.0.1
               
The example above configures and starts 4 containers in a single step:
  • CODESYS Soft PLC
  • 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.
You never fail until you stop trying.“, Albert Einstein (1879 - 1955)

  Reply


Possibly Related Threads...
Thread Author Replies Views Last Post
Information netPI Docker REST API for versions >= V1.1.4.0 Patrick@netPI 1 59 July-16th-2019, 02:45 PM
Last Post: Patrick@netPI
  Using Windows Containers a.w.d.m. 3 62 July-16th-2019, 01:46 PM
Last Post: Patrick@netPI
  [SOLVED] Pull Docker Image a.w.d.m. 8 34 July-8th-2019, 11:17 AM
Last Post: Armin@netPI
  [SOLVED] Docker issues AlexRegev 7 191 June-26th-2019, 02:14 PM
Last Post: AlexRegev
  docker timing MGharat 2 34 June-13th-2019, 08:57 AM
Last Post: Patrick@netPI
  RTE3 Use real time ethernet as "normal" ethernet interface hannes 50 280 May-9th-2019, 04:28 PM
Last Post: Armin@netPI
  [INFO]Docker DNS server Armin@netPI 0 19 March-7th-2019, 09:02 AM
Last Post: Armin@netPI
  [SOLVED] node-red Dashboard Docker Image for netPI? anrodriguez 1 23 February-7th-2019, 05:35 PM
Last Post: Armin@netPI
  Multi-stage builds for slim container images Armin@netPI 0 10 February-7th-2019, 04:14 PM
Last Post: Armin@netPI
  Setup trusted Docker registry on a Raspberry Pi to host netPI containers Armin@netPI 12 637 January-31st-2019, 06:47 PM
Last Post: Armin@netPI

Forum Jump:


Users browsing this thread: 1 Guest(s)