소스 검색

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)
Peter Waller 11 년 전
부모
커밋
32753c3d24
1개의 변경된 파일3개의 추가작업 그리고 3개의 파일을 삭제
  1. 3 3
      container.go

+ 3 - 3
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 {