add net param support
Signed-off-by: Peter Flood <info@whywouldwe.com>
This commit is contained in:
parent
1e7e8202af
commit
6b8044e92c
4 changed files with 28 additions and 2 deletions
|
|
@ -679,7 +679,7 @@ class Client(requests.Session):
|
|||
True)
|
||||
|
||||
def start(self, container, binds=None, volumes_from=None, port_bindings=None,
|
||||
lxc_conf=None, publish_all_ports=False, links=None, privileged=False):
|
||||
lxc_conf=None, publish_all_ports=False, links=None, privileged=False, network_mode=None):
|
||||
if isinstance(container, dict):
|
||||
container = container.get('Id')
|
||||
|
||||
|
|
@ -726,6 +726,9 @@ class Client(requests.Session):
|
|||
|
||||
start_config['Privileged'] = privileged
|
||||
|
||||
if network_mode:
|
||||
start_config['NetworkMode'] = network_mode
|
||||
|
||||
url = self._url("/containers/{0}/start".format(container))
|
||||
res = self._post_json(url, data=start_config)
|
||||
self._raise_for_status(res)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue