I have a web application running in docker container, and a kafka broker running in another docker container. I am using docker-compose to setup up the docker containers. but I found that it is a little difficult to config the networking for docker containers. so, I posted some questions: Java & Kafka: Connection to node 999 could not be established. Broker may not be available
I got some hits to setup advertised.host.name
the from here Cannot produce message to kafka from service running in docker. Now, my web application can produce the messages to the kafka docker container. But I got another issue: I can get docker host ip by ifconfig docker0
, and hardcoded it in docker-compose.yml. I have no idea how to get it in mac. Our docker-compose files are for dev, and they should be run in lots of developers' computers. so, we need some reliable way to get the ip automatically and dynamically by some programs.
Any ideas? thanks