I am using docker-compose to start two containers (named fd & fl4j). Second container connects to the first on startup.
If I just use "host" networking, and plain "docker run" everything works fine.
With docker-compose and a defined bridge network (loggernw) the second container fails to connect to the first. May not be relevant but stating - the second container is a java spring-boot app.
Additional info: Even without docker-compose but using a "docker run" and a defined bridge network, the connection attempt fails. Also, within the second app, I am using the string "127.0.0.1" to attempt connection.
docker-compose below -
version: '3.8'
services:
fd:
image: fluentwithes
container_name: fd
ports:
- 24224:24224
expose:
- "24224"
volumes:
- /home/hrishikesh/work/bitbucket/logger/integration/docker/runs/fluentd:/fluentd/etc
networks:
- loggernw
fl4j:
image: fluentl4java
container_name: fl4j
ports:
- 9090:9090
expose:
- "9090"
networks:
- loggernw
networks:
loggernw:
driver: bridge