Merge pull request #28047 from cpuguy83/27773_chrootarchive_rbind

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

View File

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