mirror of
https://github.com/clearlinux/docker.git
synced 2026-09-05 13:11:30 +00:00
Always umount container rootfs and volumes on docker cp failed
Signed-off-by: Lei Jitang <leijitang@huawei.com>
This commit is contained in:
committed by
David Calavera
parent
08c55cd94b
commit
937d37fa1a
+3
-2
@@ -599,11 +599,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
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user