Set "VolumesFrom" when starting containers

This is necessary when working with Docker 0.10.0 and up. Fortunately,
we can set it both when creating and starting, and retain compatibility
with 0.8.x and 0.9.x.

recreate_containers() is now responsible for starting containers, as
well as creating them. This greatly simplifies usage of the Service
class.
This commit is contained in:
Aanand Prasad 2014-04-23 15:46:26 +01:00
commit 80991f1521
6 changed files with 46 additions and 70 deletions

View file

@ -301,10 +301,9 @@ class TopLevelCommand(Command):
"""
detached = options['-d']
new = self.project.up(service_names=options['SERVICE'])
to_attach = self.project.up(service_names=options['SERVICE'])
if not detached:
to_attach = [c for (s, c) in new]
print("Attaching to", list_containers(to_attach))
log_printer = LogPrinter(to_attach, attach_params={"logs": True})