Moving Files to Docker Data Volume
1 answer
You can do it with a container:
docker run --rm -v `pwd`:/source -v some-volume:/target \
busybox cp -av /source/somefile.txt /target/somefile.txt
I also use tar and stdin to connect files to a remote volume via a docker client / server connection:
tar -cv -C source-dir . | \
docker run --rm -i -v some-volume:/target busybox tar -xC /target
The export is similar:
docker run --rm -v some-volume:/source busybox tar -cC /source . | \
tar -xC target-dir
+1
source to share