зеркало из https://github.com/microsoft/docker.git
chroot: remount everything as private in new mntns
If parent of the destination path is shared, this path will be unmounted from the parent ns even if the path itself is private. Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
This commit is contained in:
Родитель
2c620d0aa2
Коммит
b511d1f0ca
|
@ -26,7 +26,12 @@ func chroot(path string) (err error) {
|
|||
return fmt.Errorf("Error creating mount namespace before pivot: %v", err)
|
||||
}
|
||||
|
||||
if err := mount.MakeRPrivate(path); err != nil {
|
||||
// make everything in new ns private
|
||||
if err := mount.MakeRPrivate("/"); err != nil {
|
||||
return err
|
||||
}
|
||||
// ensure path is a mountpoint
|
||||
if err := mount.MakePrivate(path); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче