Commit c1f0fe3f authored by Mitchell Hashimoto's avatar Mitchell Hashimoto

builder/docker: fix upload for copy to work

parent 5f76ed68
......@@ -8,6 +8,7 @@ import (
"log"
"os"
"os/exec"
"path/filepath"
"syscall"
"time"
)
......@@ -25,6 +26,11 @@ func (c *Communicator) Start(remote *packer.RemoteCmd) error {
return err
}
// TODO(mitchellh): We need to hijack the command to write the exit
// code to a temporary file in the shared folder so that we can read it
// out. Since we're going over a pty, we can't get the exit code another
// way.
cmd.Stdout = remote.Stdout
cmd.Stderr = remote.Stderr
......@@ -74,7 +80,8 @@ func (c *Communicator) Upload(dst string, src io.Reader) error {
// TODO(mitchellh): Copy the file into place
cmd := &packer.RemoteCmd{
Command: fmt.Sprintf("cp %s %s", tempfile.Name(), dst),
Command: fmt.Sprintf("cp %s/%s %s", c.ContainerDir,
filepath.Base(tempfile.Name()), dst),
}
if err := c.Start(cmd); err != nil {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment