Skip to content

Multiple hera instances appear to conflict with each other #10

@pirate

Description

@pirate

I've noticed when using hera with multiple projects on the same host, the moment I try to run two instances of Hera they seem to fight with eachother.
Errors about "cant find container with id " show up in both hera instance's logs when run together, but when run individually there are no errors.

Steps to reproduce

  1. Create projectA/docker-compose.yml:
version: "3"
                                                                                                                               
services:
  hera:
    image: aschzero/hera:latest
    container_name: projectA_hera
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock
      - ./data/hera:/certs
    links:
      - web
    networks:
      - projectA
                                                                                                                               
  web:
    image: nginx:latest
    expose:
      - 8080
    volumes:
      - ./etc/nginx/nginx.conf:/etc/nginx/nginx.conf
      - ./html:/var/www/html
    networks:
      - projectA
    labels:
      hera.hostname: projectA.example.com
      hera.port: 8080
    healthcheck:
      test: ["CMD", "curl", "-f", "http://localhost:8080"]

networks:
  projectA:
  1. And then create projectB/docker-compose.yml with almost the same content, just a few lines changed:
version: "3"
                                                                                                                               
services:
  hera:
    image: aschzero/hera:latest
    container_name: projectB_hera
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock
      - ./data/hera:/certs
    links:
      - web
    networks:
      - projectB
                                                                                                                               
  web:
    image: nginx:latest
    expose:
      - 8080
    volumes:
      - ./etc/nginx/nginx.conf:/etc/nginx/nginx.conf
      - ./html:/var/www/html
    networks:
      - projectB
    labels:
      hera.hostname: projectB.example.com
      hera.port: 8080
    healthcheck:
      test: ["CMD", "curl", "-f", "http://localhost:8080"]

networks:
  projectB:
  1. Start both projects cd projectA; docker-compose up -d; cd ../projectB; docker-compose up -d

  2. Errors like this appear in both separate Hera instance's docker logs:

projectA_hera  | [INFO] Unable to connect, retrying... (4/5)
projectA_hera  | [INFO] Unable to connect, retrying... (5/5)
projectA_hera  | [ERROR] Unable to connect to e8f8bfe62cb8
projectA_hera  | [INFO] Container found, connecting to db3985d686ee...
projectA_hera  | [INFO] Unable to connect, retrying... (1/5)
projectA_hera  | [INFO] Unable to connect, retrying... (2/5)
projectA_hera  | [INFO] Unable to connect, retrying... (3/5)
projectA_hera  | [INFO] Unable to connect, retrying... (4/5)
projectA_hera  | [INFO] Unable to connect, retrying... (5/5)
projectA_hera  | [ERROR] Unable to connect to db3985d686ee
projectA_hera  | [INFO] Container found, connecting to 2754df6f4c5b...
projectA_hera  | [INFO] Unable to connect, retrying... (1/5)
projectA_hera  | [INFO] Unable to connect, retrying... (2/5)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions