mirror of
https://github.com/docker/compose.git
synced 2025-07-20 20:24:30 +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']
|
detached = options['-d']
|
||||||
|
|
||||||
self.project.create_containers(service_names=options['SERVICE'])
|
(old, new) = self.project.recreate_containers(service_names=options['SERVICE'])
|
||||||
containers = self.project.containers(service_names=options['SERVICE'], stopped=True)
|
|
||||||
|
|
||||||
if not detached:
|
if not detached:
|
||||||
print("Attaching to", list_containers(containers))
|
to_attach = [c for (s, c) in new]
|
||||||
log_printer = LogPrinter(containers)
|
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:
|
if not detached:
|
||||||
try:
|
try:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user