From 80c18004c10207a5c2afd23090083f7337d60430 Mon Sep 17 00:00:00 2001 From: Geoff Bourne Date: Fri, 7 Apr 2017 19:35:15 -0500 Subject: [PATCH] [mc] Integrate rcon-cli --- minecraft-server/Dockerfile | 2 ++ minecraft-server/README.md | 10 ++++++++++ 2 files changed, 12 insertions(+) diff --git a/minecraft-server/Dockerfile b/minecraft-server/Dockerfile index 195476e2..9ed91dbd 100644 --- a/minecraft-server/Dockerfile +++ b/minecraft-server/Dockerfile @@ -27,6 +27,7 @@ RUN addgroup -g 1000 minecraft \ EXPOSE 25565 25575 ADD https://github.com/itzg/restify/releases/download/1.0.4/restify_linux_amd64 /usr/local/bin/restify +ADD https://github.com/itzg/rcon-cli/releases/download/1.2/rcon-cli_linux_amd64 /usr/local/bin/rcon-cli COPY start.sh /start COPY start-minecraft.sh /start-minecraft COPY mcadmin.jq /usr/share @@ -42,4 +43,5 @@ ENV UID=1000 GID=1000 \ MOTD="A Minecraft Server Powered by Docker" \ JVM_XX_OPTS="-XX:+UseG1GC" MEMORY="1G" \ TYPE=VANILLA VERSION=LATEST FORGEVERSION=RECOMMENDED LEVEL=world PVP=true DIFFICULTY=easy \ + ENABLE_RCON=true RCON_PORT=25575 RCON_PASSWORD=minecraft \ LEVEL_TYPE=DEFAULT GENERATOR_SETTINGS= WORLD= MODPACK= ONLINE_MODE=TRUE CONSOLE=true diff --git a/minecraft-server/README.md b/minecraft-server/README.md index a218c207..569c8d6f 100644 --- a/minecraft-server/README.md +++ b/minecraft-server/README.md @@ -35,6 +35,16 @@ With that you can easily view the logs, stop, or re-start the container: ## Interacting with the server +[RCON](http://wiki.vg/RCON) is enabled by default, so you can `exec` into the container to +access the Minecraft server console: + +``` +docker exec -it mc rcon-cli +``` + +Replacing `mc` with your container's name or ID. The `-it` is important needed for interactive +access to the console. + In order to attach and interact with the Minecraft server, add `-it` when starting the container, such as docker run -d -it -p 25565:25565 --name mc itzg/minecraft-server