Giter VIP home page Giter VIP logo

Comments (10)

itzg avatar itzg commented on July 21, 2024 4

@Oliver84 in your compose file you'll need these two items:

https://github.com/itzg/docker-minecraft-bedrock-server/blob/master/examples/docker-compose.yml#L14-L15

With that and restarting the container you'll then be able to use docker attach.

from docker-minecraft-bedrock-server.

Nitrosito avatar Nitrosito commented on July 21, 2024 1

Of course @itzg !
I modify my docker-compose to set similar entrypoint

Thanks and regards

from docker-minecraft-bedrock-server.

cyclingwithelephants avatar cyclingwithelephants commented on July 21, 2024 1

To get into the shell of a running container you should execute

kubectl exec -it --namespace ${NAMESPACE} ${POD_ID} bash

this opens a bash terminal that you can use to navigate, in the present working directory of the container. YOU NEED the -it flags, the i stands for interactive (I forget what t stands for, but man kubectl is your friend) from this point you can use the excellent rcon-cli tool by the same author.

Iif you're using docker but not k8s then replace kubectl with docker and remove the namespace argument, the pod ID will instead be the UID of the container, I believe you can find this using docker ps (I may be forgetting some flags)

from docker-minecraft-bedrock-server.

itzg avatar itzg commented on July 21, 2024

docker attach should work in some form; however, I haven't experimented to see what combination of parameters need to be set on the container initially. I'm guessing -i and -t are probably needed on the docker run (or the equivalent settings in compose).

With that said, the bedrock server doesn't natively support rcon, which is what gets leveraged in my Java edition image. I'm thinking of enhancing the process wrapper with rcon or rcon-like console support, so that commands can be sent more easily.

from docker-minecraft-bedrock-server.

itzg avatar itzg commented on July 21, 2024

...as a quick experiment, I started a container with

docker run --rm -it -e EULA=TRUE itzg/minecraft-bedrock-server

and was able to attach and send the "help" command using:

docker attach 3c1633c5e90b
DEBU[0076] Forwarding signal                             signal="window changed"
DEBU[0076] Forwarding signal                             signal="window changed"
help
§2--- Showing help page 1 of 18 (/help <page>) ---
/? [command: CommandName]
/? <page: int>
/alwaysday [true|false]
/changesetting allow-cheats <true|false>
/changesetting difficulty <value: Difficulty>
/changesetting difficulty <value: int>
/clear [player: target] [itemName: Item] [data: int] [maxCount: int]
§2Tip: Use the <tab> key while typing a command to auto-complete the command or its arguments
read escape sequence

I then used Ctrl-P and Ctrl-Q to detach and leave the container running.

Is that sufficient for your deployment?

from docker-minecraft-bedrock-server.

bingobob avatar bingobob commented on July 21, 2024

I was trying to do the same thing. i.e. attach to server console to monitor stuff and issue commands. Would be interested in any progress here. thanks. good work, thanks for this.

from docker-minecraft-bedrock-server.

Oliver84 avatar Oliver84 commented on July 21, 2024

Of course @itzg !
I modify my docker-compose to set similar entrypoint

Thanks and regards

Can you share how you attached to this with docker-compose? I started the server with docker-compose but when I attached, it's not taking any of my input commands.

from docker-minecraft-bedrock-server.

dominic-ks avatar dominic-ks commented on July 21, 2024

Hey @itzg, sorry to comment on an old issue, but can I clarify that it's suggested here that I should be able to just use docker attach and then run commands for the Minecraft server directly in the terminal? I can attach no problem, and have tried with the stdin_open and tty options you pointed to in the example compose file, but I just get a regular bash terminal, running help just shows me Linux commands, and attempting to run any Minecraft commands it tells me they're not found. Have I missed something?

from docker-minecraft-bedrock-server.

itzg avatar itzg commented on July 21, 2024

I just get a regular bash terminal, running help just shows me Linux commands

In that case the docker attach didn't actually work or you're not doing something right. Make sure you're not doing an exec which will execute a new shell within the container.

from docker-minecraft-bedrock-server.

dominic-ks avatar dominic-ks commented on July 21, 2024

you're not doing something right

Yep, I assumed that using the VS Code Docker extension and clicking "attach" on it would run attach, which I guess it does not.

Cheers!

from docker-minecraft-bedrock-server.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.