mirror of
https://github.com/docker/compose.git
synced 2025-07-29 16:44:20 +02:00
Fix race condition in docker-compose run
We shouldn't start the container before handing it off to dockerpty - dockerpty will start it after attaching, which is the correct order. Otherwise the container might exit before we attach to it, which can lead to weird bugs. Signed-off-by: Aanand Prasad <aanand.prasad@gmail.com>
This commit is contained in:
parent
c8022457eb
commit
862971cffa
@ -341,7 +341,6 @@ class TopLevelCommand(Command):
|
|||||||
service.start_container(container)
|
service.start_container(container)
|
||||||
print(container.name)
|
print(container.name)
|
||||||
else:
|
else:
|
||||||
service.start_container(container)
|
|
||||||
dockerpty.start(project.client, container.id, interactive=not options['-T'])
|
dockerpty.start(project.client, container.id, interactive=not options['-T'])
|
||||||
exit_code = container.wait()
|
exit_code = container.wait()
|
||||||
if options['--rm']:
|
if options['--rm']:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user