Report this

What is the reason for this report?

Hi, I am facing issue with creating multiple containers from the same imagee.

Posted on July 28, 2021

Currently, I am able to the same but with only one container by assigning static ip addresses to the container. Not sure how to implement this for multiple ones. Each rtu needs to have a diff IP adress and be associated with a ctrl unit. This ctrl unit is then connected to a network, linked to a gateway.

services:
  rtu_a:
    logging:
      driver: "json-file"
      options:
        max-size: "200k"
        max-file: "10"
    image: ${REGISTRY_PREFIX}testbed/modbus${REGISTRY_TAG}
    volumes:
      - ./volume:/var/lib/my_volume
    build:
      context: .
      cache_from:
        - ${REGISTRY_PREFIX}modbus${REGISTRY_TAG}
        - ${REGISTRY_PREFIX}modbus:${CI_COMMIT_REF_SLUG}
        - ${REGISTRY_PREFIX}modbus:master
    networks:
      rtu-ctrl-net-a:
        ipv4_address: 172.31.0.101
    command: python3 rtu_unit.py "rtu_a"

  ctrl_unit_a:
    logging:
      driver: "json-file"
      options:
        max-size: "200k"
        max-file: "10"
    image: ${REGISTRY_PREFIX}testbed/modbus${REGISTRY_TAG}
    volumes:
      - ./volume:/var/lib/my_volume
    depends_on:
      - rtu_a
    networks:
      rtu-ctrl-net-a:
        ipv4_address: 172.31.0.102
    command: python3 ctrl_unit.py rtu_a 1 "ctrl_unit_a"


This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Im not expert on this but I think you need to fix the network it self and connections

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Start building today

From GPU-powered inference and Kubernetes to managed databases and storage, get everything you need to build, scale, and deploy intelligent applications.