From 3bfb70db243d35b969eba9781dec619b7c52be98 Mon Sep 17 00:00:00 2001 From: "Guillaume J. Charmes" Date: Fri, 19 Apr 2013 18:06:13 -0700 Subject: [PATCH] Wait for the container terminate at the end of CmdRun Fixes the race condition between docker run and docker logs from #428. --- commands.go | 1 + 1 file changed, 1 insertion(+) diff --git a/commands.go b/commands.go index 2ca026eb81..4fe91bb8eb 100644 --- a/commands.go +++ b/commands.go @@ -975,6 +975,7 @@ func (srv *Server) CmdRun(stdin io.ReadCloser, stdout rcli.DockerConn, args ...s } Debugf("Waiting for attach to return\n") <-attachErr + container.Wait() // Expecting I/O pipe error, discarding return nil }