From eabd32f3cea7d0f4c74b492d89f1ff995fc2fb48 Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Sat, 9 Nov 2013 00:06:45 -0800 Subject: [PATCH] builder/docker: comment the sleep on remote exec --- builder/docker/communicator.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/builder/docker/communicator.go b/builder/docker/communicator.go index ccb5830c0..01889b638 100644 --- a/builder/docker/communicator.go +++ b/builder/docker/communicator.go @@ -41,7 +41,14 @@ func (c *Communicator) Start(remote *packer.RemoteCmd) error { go func() { defer stdin_w.Close() + + // This sleep needs to be here because of the issue linked to below. + // Basically, without it, Docker will hang on reading stdin forever, + // and won't see what we write, for some reason. + // + // https://github.com/dotcloud/docker/issues/2628 time.Sleep(2 * time.Second) + stdin_w.Write([]byte(remote.Command + "\n")) }()