Skip to content

Commit 7c8e6c8

Browse files
committed
Fix CopyData in Bind Mount
CopyData is an action which should be enabled only in mount volumes and images. For example: [root@hostname]# pouch run -it --name test2 -v /home/baijia.wr/volume/:/var/ docker.io/library/busybox:latest ls /var/ spool www [root@hostname]# ls /home/baijia.wr/volume/ spool www Without this patch, data is copied form container's dir "/var/" to host's dir "/home/baijia.wr/volume/", that is unexpected. So CopyData should be disabled in bind mount. Signed-off-by: Wang Rui <[email protected]>
1 parent aa61bb1 commit 7c8e6c8

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

daemon/mgr/container_storage.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,8 @@ func (mgr *ContainerManager) getMountPointFromBinds(ctx context.Context, c *Cont
169169
return err
170170
}
171171

172+
mp.CopyData = false
173+
172174
if !path.IsAbs(mp.Source) {
173175
// volume bind.
174176
name := mp.Source

0 commit comments

Comments
 (0)