itzg / docker-minecraft-bedrock-server

Containerized Minecraft Bedrock Dedicated Server with selectable version
MIT License
1.14k stars 219 forks source link

Trying to update bedrock Minecraft server in Docker on macOS and load existing volume with Minecraft world we have been working on #466

Open txchou opened 6 days ago

txchou commented 6 days ago

Hi

As noted, we have a bedrock server which needed updating. I couldn't figure out to update the existing container so made a new one. But I can't seem to load old volumes - it seems to keep creating new ones. Unfortunately, as I'm a bit of a novice - it's a bit of a mess with a bunch of containers and volumes. I've tried numerous times with ChatGPT assistance but seem to be going around in circles making new containers which generate new worlds/volumes.

Before I give up and lose the kids' world that we've been working on for a while - thought I'd ask here.

docker-compose.yml looks like this:

services:
  minecraft:
    image: itzg/minecraft-bedrock-server:latest
    container_name: happy_blackburn
    environment:
      - EULA=TRUE
    volumes:
      - mc-bedrock-data:/data
    ports:
      - "19132:19132/udp"
volumes:
  mc-bedrock-data:

But it just seems to create a new volume:


        "Mounts": [
            {
                "Type": "volume",
                "Source": "minecraft-server_mc-bedrock-data",
                "Target": "/data",
                "VolumeOptions": {}
            }

If anyone can point me in the right direction, would be grateful!

itzg commented 5 days ago

What command(s) are you using the apply the changes? What are you showing in the second code snippet? Is that output from the docker inspect command?

txchou commented 5 days ago

Thanks. I managed to get it working. ChatGPT > Copilot.

The command was “docker run”. But I managed to get it working by specifying the volume and other info directly in the command line.

Yeah. The second part was insights from the docker desktop app. Was just showing how docker kept creating a new volume rather than linking to the existing one.

I have no idea why it worked putting it directly in the command but hope that helps someone else know the same boat.

itzg commented 4 days ago

To clarify, you ended up doing what was already documented:

https://github.com/itzg/docker-minecraft-bedrock-server/tree/master#quickstart

If you want a persistent volume then yes, you must declare that as a -v argument, as shown.