How to run docker containers in host network mode using docker-compose?

橙三吉。 提交于 2021-02-17 04:42:23

问题


I need to run containers from docker-compose in host network mode. For example, if I run single container, I write:

docker run --net=host my_image

How to do this part --net=host in docker-compose?


回答1:


The equivalent in docker-comopose is network_mode: host see the documentation in: https://docs.docker.com/compose/compose-file/



来源:https://stackoverflow.com/questions/44658101/how-to-run-docker-containers-in-host-network-mode-using-docker-compose

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