Skip to content

Instantly share code, notes, and snippets.

@izquiratops
Created April 21, 2025 08:31
Show Gist options
  • Save izquiratops/d73647900da218d5aa3500b49d608f0e to your computer and use it in GitHub Desktop.
Save izquiratops/d73647900da218d5aa3500b49d608f0e to your computer and use it in GitHub Desktop.
Rename docker volume
# 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