Browse code

Wait for the container terminate at the end of CmdRun

Fixes the race condition between docker run and docker logs from #428.

Guillaume J. Charmes authored on 2013/04/20 10:06:13
Showing 1 changed files
... ...
@@ -975,6 +975,7 @@ func (srv *Server) CmdRun(stdin io.ReadCloser, stdout rcli.DockerConn, args ...s
975 975
 	}
976 976
 	Debugf("Waiting for attach to return\n")
977 977
 	<-attachErr
978
+	container.Wait()
978 979
 	// Expecting I/O pipe error, discarding
979 980
 	return nil
980 981
 }