mirror of https://github.com/docker/docs.git
Fix for issue #3786
This is a fix for the case that one mount is inside another mount and docker can't then delete the resulting container. Docker-DCO-1.1-Signed-off-by: Peter Waller <p@pwaller.net> (github: pwaller)
This commit is contained in:
parent
ffdc2d2657
commit
32753c3d24
|
@ -1365,9 +1365,9 @@ func (container *Container) Unmount() error {
|
||||||
mounts = append(mounts, path.Join(root, r))
|
mounts = append(mounts, path.Join(root, r))
|
||||||
}
|
}
|
||||||
|
|
||||||
for _, m := range mounts {
|
for i := len(mounts) - 1; i >= 0; i-- {
|
||||||
if lastError := mount.Unmount(m); lastError != nil {
|
if lastError := mount.Unmount(mounts[i]); lastError != nil {
|
||||||
err = lastError
|
err = fmt.Errorf("Failed to umount %v: %v", mounts[i], lastError)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
Loading…
Reference in New Issue