Browse Source

Merge pull request #14432 from coolljt0725/umount_rootf_on_cp_fail

Always umount container rootfs and volumes on docker cp failed
Brian Goff 10 năm trước cách đây
mục cha
commit
045ccc4326
1 tập tin đã thay đổi với 3 bổ sung2 xóa
  1. 3 2
      daemon/container.go

+ 3 - 2
daemon/container.go

@@ -622,11 +622,12 @@ func (container *Container) Copy(resource string) (io.ReadCloser, error) {
 		return nil, err
 	}
 	for _, m := range mounts {
-		dest, err := container.GetResourcePath(m.Destination)
+		var dest string
+		dest, err = container.GetResourcePath(m.Destination)
 		if err != nil {
 			return nil, err
 		}
-		if err := mount.Mount(m.Source, dest, "bind", "rbind,ro"); err != nil {
+		if err = mount.Mount(m.Source, dest, "bind", "rbind,ro"); err != nil {
 			return nil, err
 		}
 	}