Merge pull request #28047 from cpuguy83/27773_chrootarchive_rbind

Fix issue with cp to container volume dir
This commit is contained in:
Michael Crosby 2016-11-09 10:52:14 -08:00 committed by GitHub
commit da0ccf8e61

View file

@ -30,9 +30,11 @@ func chroot(path string) (err error) {
if err := mount.MakeRPrivate("/"); err != nil { if err := mount.MakeRPrivate("/"); err != nil {
return err return err
} }
// ensure path is a mountpoint
if err := mount.MakePrivate(path); err != nil { if mounted, _ := mount.Mounted(path); !mounted {
return err if err := mount.Mount(path, path, "bind", "rbind,rw"); err != nil {
return realChroot(path)
}
} }
// setup oldRoot for pivot_root // setup oldRoot for pivot_root