Skip to content
This repository has been archived by the owner on Mar 28, 2018. It is now read-only.

Docker cp does not work with devicemapper storage driver #1004

Open
jcvenegas opened this issue Jun 22, 2017 · 0 comments
Open

Docker cp does not work with devicemapper storage driver #1004

jcvenegas opened this issue Jun 22, 2017 · 0 comments
Labels

Comments

@jcvenegas
Copy link
Contributor

jcvenegas commented Jun 22, 2017

Devicemapper storage driver uses dedicated block devices rather than formatted filesystems, and operates at the block level rather than file level. We use this knowledge to directly use the underlying block device instead of the overlay file system for the container root file system for better I/O performance. The block device maps to the top read-write layer for the overlay. We mount this block device within the VM.

The approach above introduces a limitation in terms of dynamic file copy in/out of the container via docker cp operations:

docker cp [OPTIONS] SRC_PATH|- CONTAINER:DEST_PATH
docker cp [OPTIONS] CONTAINER:SRC_PATH DEST_PATH|-

The first docker cp operation from host to container accesses the mounted file system on the host side, which will not be in sync. This is not expected to work and may lead to inconsistencies as the block device will be simultaneously written to from two different mounts

The docker cp operation from container to host should work, provided a sync is run inside the container prior to the copy.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants