Created
April 21, 2025 08:31
-
-
Save izquiratops/d73647900da218d5aa3500b49d608f0e to your computer and use it in GitHub Desktop.
Rename docker volume
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# One line to rename docker volume from 'old-volume' to 'new-volume' | |
docker volume create --name new-volume \ | |
&& docker run --rm -it \ | |
-v old-volume:/from \ | |
-v new-volume:/to \ | |
alpine ash -c 'cd /from ; cp -av . /to' \ | |
&& docker volume rm old-volume |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment