docker-py将网络模式设置为主机

时间:2017-05-24 09:04:00

标签: python-2.7 docker docker-compose dockerpy

我有docker Docker version 1.10.3, build 20f81dd和客户docker-py==1.9.0。我希望能够通过python客户端设置--net=host(docker)或net: host(docker-compose)设置,但文档说network_mode is available since v1.11

如何通过python客户端模拟此行为?

1 个答案:

答案 0 :(得分:0)

我在文档中看到

https://docker-py.readthedocs.io/en/stable/containers.html#container-objects

除其他外

host - > Use the host network stack.