container: Use lazy unmount

Unmount recursively to unmount bind-mounted volumes.
Fixes: #965
Signed-off-by: Ning Lu <crossrunning@outlook.com>
This commit is contained in:
running 2018-12-02 22:02:55 +08:00 committed by running99
parent 8764fc1467
commit c099be56da

View File

@ -544,7 +544,7 @@ func (c *Container) unmountHostMounts() error {
span, _ := c.trace("unmount") span, _ := c.trace("unmount")
span.SetTag("host-path", m.HostPath) span.SetTag("host-path", m.HostPath)
if err := syscall.Unmount(m.HostPath, 0); err != nil { if err := syscall.Unmount(m.HostPath, syscall.MNT_DETACH); err != nil {
c.Logger().WithFields(logrus.Fields{ c.Logger().WithFields(logrus.Fields{
"host-path": m.HostPath, "host-path": m.HostPath,
"error": err, "error": err,