chroot: let root be cleaned up by kernel

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
(cherry picked from commit 70dfea63ba)
Signed-off-by: Victor Vieux <vieux@docker.com>
This commit is contained in:
Tonis Tiigi 2016-10-20 15:34:23 -07:00 committed by Victor Vieux
parent 3b9269760c
commit 3f21a28ec0

View file

@ -52,13 +52,6 @@ func chroot(path string) (err error) {
err = errCleanup
}
}
if errCleanup := syscall.Unmount("/", syscall.MNT_DETACH); errCleanup != nil {
if err == nil {
err = fmt.Errorf("error unmounting root: %v", errCleanup)
}
return
}
}()
if err := syscall.PivotRoot(path, pivotDir); err != nil {