Skip to content

Instantly share code, notes, and snippets.

@itzg
Created February 6, 2024 17:44
Show Gist options
  • Save itzg/8a611b62706bee8c5f5fe3af2ac204cb to your computer and use it in GitHub Desktop.
Save itzg/8a611b62706bee8c5f5fe3af2ac204cb to your computer and use it in GitHub Desktop.
Convert docker minecraft managed volume to host directory

Assuming the use of a compose file such as the following with a managed volume

services:
  mc:
    # ...
    volumes:
      - mc-data:/data
volumes:
  mc-data: {}

Copy the data volume's content to a relative directory

docker compose cp mc:/data ./data

Change the volume entry to

services:
  mc:
    # ...
    volumes:
      - ./data:/data
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment