From 862971cffa9db04f597acf0cd01e55b66681579e Mon Sep 17 00:00:00 2001 From: Aanand Prasad Date: Fri, 15 May 2015 12:16:24 +0100 Subject: [PATCH] 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 --- compose/cli/main.py | 1 - 1 file changed, 1 deletion(-) diff --git a/compose/cli/main.py b/compose/cli/main.py index a2375516e..19e4e9378 100644 --- a/compose/cli/main.py +++ b/compose/cli/main.py @@ -341,7 +341,6 @@ class TopLevelCommand(Command): service.start_container(container) print(container.name) else: - service.start_container(container) dockerpty.start(project.client, container.id, interactive=not options['-T']) exit_code = container.wait() if options['--rm']: