From 5f76ed68c42ae4d39de78e28f8760689623373aa Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Fri, 8 Nov 2013 23:59:25 -0800 Subject: [PATCH] builder/docker: Remote execution works! /cc @mwhooker - WOW. By luck, I had a hunch that maybe something like this might be going on based on straces I was reading. Check: https://github.com/dotcloud/docker/issues/2628 Anyways, this works now. No more blocker! --- builder/docker/communicator.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/builder/docker/communicator.go b/builder/docker/communicator.go index dddd27042..58ba732fb 100644 --- a/builder/docker/communicator.go +++ b/builder/docker/communicator.go @@ -9,6 +9,7 @@ import ( "os" "os/exec" "syscall" + "time" ) type Communicator struct { @@ -34,6 +35,7 @@ func (c *Communicator) Start(remote *packer.RemoteCmd) error { go func() { defer stdin_w.Close() + time.Sleep(2 * time.Second) stdin_w.Write([]byte(remote.Command + "\n")) }() @@ -49,9 +51,8 @@ func (c *Communicator) Start(remote *packer.RemoteCmd) error { } } - if exitStatus != 0 { - return fmt.Errorf("Exit status: %d", exitStatus) - } + // Say that we ended! + remote.SetExited(exitStatus) return nil }