Merge pull request #4443 from mitchellh/preservedockermode
communicator/docker: preserve file mode.
This commit is contained in:
commit
485fa58b43
|
@ -70,11 +70,15 @@ func (c *Communicator) Upload(dst string, src io.Reader, fi *os.FileInfo) error
|
||||||
|
|
||||||
// Copy the contents to the temporary file
|
// Copy the contents to the temporary file
|
||||||
_, err = io.Copy(tempfile, src)
|
_, err = io.Copy(tempfile, src)
|
||||||
tempfile.Close()
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if fi != nil {
|
||||||
|
tempfile.Chmod((*fi).Mode())
|
||||||
|
}
|
||||||
|
tempfile.Close()
|
||||||
|
|
||||||
// Copy the file into place by copying the temporary file we put
|
// Copy the file into place by copying the temporary file we put
|
||||||
// into the shared folder into the proper location in the container
|
// into the shared folder into the proper location in the container
|
||||||
cmd := &packer.RemoteCmd{
|
cmd := &packer.RemoteCmd{
|
||||||
|
|
Loading…
Reference in New Issue