From 6a2d528d2e278cb93cc76bdce38087d867804b7e Mon Sep 17 00:00:00 2001 From: Ben Firshman Date: Mon, 16 Dec 2013 11:22:54 +0000 Subject: [PATCH] Add port binding --- plum/service.py | 7 ++++++- requirements.txt | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/plum/service.py b/plum/service.py index ff198ee49..940859d35 100644 --- a/plum/service.py +++ b/plum/service.py @@ -34,10 +34,15 @@ class Service(object): self.stop_container() def start_container(self, **override_options): - container = self.client.create_container(**self._get_container_options(override_options)) + container_options = self._get_container_options(override_options) + container = self.client.create_container(**container_options) + port_bindings = {} + for port in container_options.get('ports', []): + port_bindings[port] = None self.client.start( container['Id'], links=self._get_links(), + port_bindings=port_bindings, ) return container['Id'] diff --git a/requirements.txt b/requirements.txt index 6d769742f..8523db079 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,3 +1,3 @@ -git+git://github.com/dotcloud/docker-py.git@4fde1a242e1853cbf83e5a36371d8b4a49501c52 +git+git://github.com/dotcloud/docker-py.git@5c928dcab51a276f421a36d584c37b745b3b9a3d docopt==0.6.1 PyYAML==3.10