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!
This commit is contained in:
parent
4cdd532a93
commit
41b17c3316
|
@ -9,6 +9,7 @@ import (
|
||||||
"os"
|
"os"
|
||||||
"os/exec"
|
"os/exec"
|
||||||
"syscall"
|
"syscall"
|
||||||
|
"time"
|
||||||
)
|
)
|
||||||
|
|
||||||
type Communicator struct {
|
type Communicator struct {
|
||||||
|
@ -34,6 +35,7 @@ func (c *Communicator) Start(remote *packer.RemoteCmd) error {
|
||||||
|
|
||||||
go func() {
|
go func() {
|
||||||
defer stdin_w.Close()
|
defer stdin_w.Close()
|
||||||
|
time.Sleep(2 * time.Second)
|
||||||
stdin_w.Write([]byte(remote.Command + "\n"))
|
stdin_w.Write([]byte(remote.Command + "\n"))
|
||||||
}()
|
}()
|
||||||
|
|
||||||
|
@ -49,9 +51,8 @@ func (c *Communicator) Start(remote *packer.RemoteCmd) error {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if exitStatus != 0 {
|
// Say that we ended!
|
||||||
return fmt.Errorf("Exit status: %d", exitStatus)
|
remote.SetExited(exitStatus)
|
||||||
}
|
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue