How to bind the published port to specific eth[x] in docker swarm mode

会有一股神秘感。 提交于 2019-12-04 18:48:20

问题


I'm trying to deploy my container to docker swarm cluster(docker engine 1.12.1).

The features of docker swarm mode really are exciting, such as clustering docker, multi-host networking.

However I find something can't be archived in swarm mode so far(docker 1.12.x), which works well when using docker run to start container.

My host has eth0 for Intranet network, eth1 for Internet network. I would like to only publish the service deployed by docker service create on Intranet network. But the service would listen both eth0 and eth1 interfaces after creating the service via docker service create --name my_web --publish 8000:80 my_web_image.

Any solution/workaround to archive the my_web service only listening on eth0 interface?


回答1:


Unfortunately, it seems like this is currently not supported.



来源:https://stackoverflow.com/questions/39471709/how-to-bind-the-published-port-to-specific-ethx-in-docker-swarm-mode

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!