mirror of
https://github.com/docker/compose.git
synced 2025-07-21 12:44:54 +02:00
Rework 'fig up' to use recreate_containers()
This commit is contained in:
parent
f5f9357736
commit
5db6c9f51b
@ -220,14 +220,18 @@ class TopLevelCommand(Command):
|
||||
"""
|
||||
detached = options['-d']
|
||||
|
||||
self.project.create_containers(service_names=options['SERVICE'])
|
||||
containers = self.project.containers(service_names=options['SERVICE'], stopped=True)
|
||||
(old, new) = self.project.recreate_containers(service_names=options['SERVICE'])
|
||||
|
||||
if not detached:
|
||||
print("Attaching to", list_containers(containers))
|
||||
log_printer = LogPrinter(containers)
|
||||
to_attach = [c for (s, c) in new]
|
||||
print("Attaching to", list_containers(to_attach))
|
||||
log_printer = LogPrinter(to_attach)
|
||||
|
||||
self.project.start(service_names=options['SERVICE'])
|
||||
for (service, container) in new:
|
||||
service.start_container(container)
|
||||
|
||||
for (service, container) in old:
|
||||
container.remove()
|
||||
|
||||
if not detached:
|
||||
try:
|
||||
|
Loading…
x
Reference in New Issue
Block a user