Merge pull request #28047 from cpuguy83/27773_chrootarchive_rbind
Fix issue with cp to container volume dir
This commit is contained in:
commit
da0ccf8e61
1 changed files with 5 additions and 3 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue