mirror of https://github.com/docker/compose.git
Add logging to start and stop
This commit is contained in:
parent
90130eec65
commit
cb366eed7a
|
@ -61,6 +61,7 @@ class Service(object):
|
||||||
port_bindings[int(internal_port)] = int(external_port)
|
port_bindings[int(internal_port)] = int(external_port)
|
||||||
else:
|
else:
|
||||||
port_bindings[int(port)] = None
|
port_bindings[int(port)] = None
|
||||||
|
log.info("Starting %s..." % container_options['name'])
|
||||||
self.client.start(
|
self.client.start(
|
||||||
container['Id'],
|
container['Id'],
|
||||||
links=self._get_links(),
|
links=self._get_links(),
|
||||||
|
@ -69,9 +70,10 @@ class Service(object):
|
||||||
return container
|
return container
|
||||||
|
|
||||||
def stop_container(self):
|
def stop_container(self):
|
||||||
container_id = self.containers[-1]['Id']
|
container = self.containers[-1]
|
||||||
self.client.kill(container_id)
|
log.info("Stopping and removing %s..." % get_container_name(container))
|
||||||
self.client.remove_container(container_id)
|
self.client.kill(container)
|
||||||
|
self.client.remove_container(container)
|
||||||
|
|
||||||
def next_container_number(self):
|
def next_container_number(self):
|
||||||
numbers = [parse_name(get_container_name(c))[1] for c in self.containers]
|
numbers = [parse_name(get_container_name(c))[1] for c in self.containers]
|
||||||
|
|
Loading…
Reference in New Issue