Two hassio instances running on docker - how does that work (if it does)?

Hi,

first of all: happy new year and may 2021 by better than 2020 :wink: !

All day I have been fumbling around with a configuration issue on which I hopefully I can find help in this forum.

I want to have two instances of hassio running on the same server in an docker environment:
– one instance as a production environment, which is actually running all home automation in “production”
– one instance for “development” purposes - e.g. trying out new devices, new automations, et cetera

For setting up the docker containers I am using docker-compose, in which I have defined two environments for supervisor as follows:

# Hassio Supervisor
  hassio_prod:
    image: homeassistant/amd64-hassio-supervisor
    container_name: hassio_supervisor
    privileged: true
    entrypoint: ["/bin/bash", "-c", "/scripts/start_hassio.sh"]
    security_opt:
      - seccomp:unconfined
    environment:
      - HOMEASSISTANT_REPOSITORY=homeassistant/qemux86-64-homeassistant
      - SUPERVISOR_SHARE=/home/sven/homeautomation
      - SUPERVISOR_NAME=hassio_supervisor
      - DBUS_SYSTEM_BUS_ADDRESS=unix:path=/var/run/dbus/system_bus_socket
    volumes:
      - /home/sven/homeautomation:/data
      - ./scripts:/scripts
      - /var/run/docker.sock:/var/run/docker.sock
      - /var/run/dbus/system_bus_socket:/var/run/dbus/system_bus_socket

  hassio_dev:
    image: homeassistant/amd64-hassio-supervisor
    container_name: hassio_supervisor_dev
    privileged: true
    ports:
      - 8124:8124
    security_opt:
      - seccomp:unconfined
    environment:
      - HOMEASSISTANT_REPOSITORY=homeassistant/qemux86-64-homeassistant
      - SUPERVISOR_SHARE=/home/sven/homeautomation_dev
      - SUPERVISOR_NAME=hassio_supervisor_dev
      - DBUS_SYSTEM_BUS_ADDRESS=unix:path=/var/run/dbus/system_bus_socket
    volumes:
      - /home/sven/homeautomation_dev:/data
      - ./scripts:/scripts
      - /var/run/docker.sock:/var/run/docker.sock
      - /var/run/dbus/system_bus_socket:/var/run/dbus/system_bus_socket

The first instance boots normal with IP 192.168.1.180:8123 and loads various other containers: hassio_observer, homeassistant, hassio_multicast, hassio_cli, hassio_audio, and hassio_dns.
The internal docker IP address of this instance is: 172.30.32.2 and all related containers are within the subnet 172.30.32.x

The second instance is also being loaded but without any other containers. However, I cannot access the instance via 192.168.1.180: 8124 or any other url. This instance, however, does not have an assigned subnet within docker but refers to above mentioned additional containers within their subnet of the production environment (which is 172.30.32.x)

I also tried assigning the port 8123 to the production environment, however, that did not work as docker continues claiming that port 8123 is already being used by another container.

I am bit helpless now and would appreciate any advice how I can get his up and running, thanks!

Cheers

Sven