简体   繁体   中英

How to specify IP of docker container in Marathon?

We can map docker container port to host machine IP and port using

docker run -d -p <some-ip>:<port>:<port> --name <some-name> <docker-image>

But how to specify host machine IP while deploying the same container using Marathon? Where should I specify the IP of host machine in Marathon app spec? For my requirement specifying host IP is a necessity.

您可以使用Marathon 约束来影响应用程序的位置,但我建议一种更好的,更具前瞻性的方法不是将应用程序固定到某个节点(如果该节点发生故障怎么办?),而是使用服务发现来动态地找出应用程序正在使用的IP和端口。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM