开发者

How do I use the IP of a container as an ENV var of another container

开发者 https://www.devze.com 2022-12-07 21:55 出处:网络
I am trying to set up a docker-compose file where I have 2 services. There is a RabbitMQ broker and a publisher/consumer. In the code of the publisher/consumer, I set the connection up开发者_StackOver

I am trying to set up a docker-compose file where I have 2 services. There is a RabbitMQ broker and a publisher/consumer. In the code of the publisher/consumer, I set the connection up开发者_StackOverflow using an IP from the os environment variables. However, I am not sure how I can get the IP of a different container, and set it in the ENV variable.


Just use the compose service name instead of ip.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号