-
Notifications
You must be signed in to change notification settings - Fork 19
Open
Description
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
- 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:- And then create
projectB/docker-compose.ymlwith 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:-
Start both projects
cd projectA; docker-compose up -d; cd ../projectB; docker-compose up -d -
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
Labels
No labels