mirror of
https://github.com/gdiepen/docker-convenience-scripts.git
synced 2025-03-10 03:30:23 +00:00
change cp with tar
This commit is contained in:
parent
ba21581030
commit
1e9a58a799
1 changed files with 3 additions and 3 deletions
6
docker_clone_volume.sh
Normal file → Executable file
6
docker_clone_volume.sh
Normal file → Executable file
|
@ -13,7 +13,7 @@ then
|
|||
exit
|
||||
fi
|
||||
|
||||
if [ "$2" = "" ]
|
||||
if [ "$2" = "" ]
|
||||
then
|
||||
echo "Please provide a destination volume name"
|
||||
exit
|
||||
|
@ -40,11 +40,11 @@ fi
|
|||
|
||||
|
||||
echo "Creating destination volume \"$2\"..."
|
||||
docker volume create --name $2
|
||||
docker volume create --name $2
|
||||
echo "Copying data from source volume \"$1\" to destination volume \"$2\"..."
|
||||
docker run --rm \
|
||||
-i \
|
||||
-t \
|
||||
-v $1:/from \
|
||||
-v $2:/to \
|
||||
alpine ash -c "cd /from ; cp -av . /to"
|
||||
alpine ash -c "cd /from && tar cf - . | (cd /to && tar xvf -)"
|
||||
|
|
Loading…
Add table
Reference in a new issue