1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00

Merge pull request #14432 from coolljt0725/umount_rootf_on_cp_fail

Always umount container rootfs and volumes on docker cp failed
This commit is contained in:
Brian Goff 2015-07-07 21:04:16 -04:00
commit 045ccc4326

View file

@ -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
}
}