diff --git a/container.go b/container.go index aafda78bc7c8e4131a2287e81a37b12103e37617..c5df1f4b58244f9014a5447ec6ce476b6edae5cf 100644 --- a/container.go +++ b/container.go @@ -1365,9 +1365,9 @@ func (container *Container) Unmount() error { mounts = append(mounts, path.Join(root, r)) } - for _, m := range mounts { - if lastError := mount.Unmount(m); lastError != nil { - err = lastError + for i := len(mounts) - 1; i >= 0; i-- { + if lastError := mount.Unmount(mounts[i]); lastError != nil { + err = fmt.Errorf("Failed to umount %v: %v", mounts[i], lastError) } } if err != nil {