Skip to content

Instantly share code, notes, and snippets.

@itzg
Last active March 27, 2021 16:28
Show Gist options
  • Save itzg/fe3cb6d2b9ee6a9d817885582c0a458f to your computer and use it in GitHub Desktop.
Save itzg/fe3cb6d2b9ee6a9d817885582c0a458f to your computer and use it in GitHub Desktop.
A procedure to convert anonymous itzg/minecraft-server data volume to a named one
# The following will convert the /data from an existing container named "mc"
# into a named volume "mc" and then create a new, re-configured container
# named "mc-new".
# Keep the old container named "mc" until you have confirmed everything is good
# and then you can cleanup using `docker rm mc`
docker stop mc
docker run --rm --volumes-from mc -v mc:/new alpine cp -avT /data /new
docker run -it --name mc-new -v mc:/data -p 25565:25565 -e EULA=TRUE -e MEMORY=2G itzg/minecraft-server
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment