Benutzer-Werkzeuge

Webseiten-Werkzeuge


knowledge_base:linux:docker:clone-volume

Unterschiede

Hier werden die Unterschiede zwischen zwei Versionen der Seite angezeigt.

Link zu der Vergleichsansicht

knowledge_base:linux:docker:clone-volume [2022/05/31 21:19] – angelegt julian.lemmerichknowledge_base:linux:docker:clone-volume [2022/06/11 14:35] (aktuell) – copy over and translate to english julian.lemmerich
Zeile 1: Zeile 1:
-====== Clone Volume ======+====== Cloning a Volume ======
  
-https://www.laub-home.de/wiki/Docker_Volume_Rename_-_HowTo+Angelehnt an [https://www.laub-home.de/wiki/Docker_Volume_Rename_-_HowTo|Andread Laub] (in German). 
 + 
 +The current ''docker volume''-command has no ''rename'' option. This article shows how you can circumvent this restriction to rename a volume anyway. More correctly it copies the contents from one volume to new, correctly named volume and then deletes the old. 
 + 
 +Copy the clone-docker-volumes script from alaub's Github. 
 + 
 +<code bash> 
 +wget https://raw.githubusercontent.com/alaub81/scripts/master/clone-docker-volumes.sh 
 +chmod +x clone-docker-volumes.sh 
 +</code> 
 + 
 +this command shows current volumes 
 + 
 +<code bash> 
 +docker volume ls 
 +# creates Volume_NEW and copies Volume_OLD to Volume_NEW 
 +clone-docker-volumes.sh volume_OLD volume_NEW 
 +</code> 
 + 
 +Cleaning up afterwards: 
 + 
 +First command shows all volumes that are not assigned to a container. 
 + 
 +<code> 
 +docker volume ls -f dangling=true 
 +docker volume rm volume_ALT 
 +</code> 
 + 
 +Done!
/app/www/public/data/attic/knowledge_base/linux/docker/clone-volume.1654024744.txt.gz · Zuletzt geändert: 2022/05/31 21:19 von julian.lemmerich