From cbe856d0c01a18dada289b59f4e921dedb197048 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20T=C3=B6nsing?= Date: Wed, 14 Aug 2019 18:56:40 +0200 Subject: [PATCH] Added rcon --- Dockerfile | 6 ++++++ rcon-cli.sh | 2 ++ run_docker.sh | 1 + server.properties | 4 ++-- 4 files changed, 11 insertions(+), 2 deletions(-) create mode 100755 rcon-cli.sh diff --git a/Dockerfile b/Dockerfile index 53efff4..22ebc68 100755 --- a/Dockerfile +++ b/Dockerfile @@ -36,6 +36,12 @@ WORKDIR /data # Obtain runable jar from build stage COPY --from=build /opt/minecraft/paperspigot.jar /opt/minecraft/paperspigot.jar +# Install and run rcon +ARG RCON_CLI_VER=1.4.6 +ADD https://github.com/itzg/rcon-cli/releases/download/${RCON_CLI_VER}/rcon-cli_${RCON_CLI_VER}_linux_amd64.tar.gz /tmp/rcon-cli.tgz +RUN tar -x -C /usr/local/bin -f /tmp/rcon-cli.tgz rcon-cli && \ + rm /tmp/rcon-cli.tgz + # Obtain server config ADD server.properties /opt/minecraft/server.properties diff --git a/rcon-cli.sh b/rcon-cli.sh new file mode 100755 index 0000000..da5279d --- /dev/null +++ b/rcon-cli.sh @@ -0,0 +1,2 @@ +docker exec -i mcserver rcon-cli --host localhost --port 25575 --password glaspalast timings report + diff --git a/run_docker.sh b/run_docker.sh index 5960e78..f73cc8a 100755 --- a/run_docker.sh +++ b/run_docker.sh @@ -4,5 +4,6 @@ docker run \ -e MEMORYSIZE='1G' \ -v /Users/mtoe/Documents/mcserver:/data:rw \ -p 25565:25565 \ + -p 25575:25575 \ -i marctv/minecraft-papermc-server:latest docker attach mcserver diff --git a/server.properties b/server.properties index 76ab5e5..bb7714a 100755 --- a/server.properties +++ b/server.properties @@ -33,12 +33,12 @@ view-distance=10 resource-pack= spawn-animals=true white-list=false -rcon.password=mcserver +rcon.password=minecraft generate-structures=true online-mode=true max-build-height=256 level-seed= prevent-proxy-connections=false use-native-transport=true -enable-rcon=false +enable-rcon=true motd=A DOCKER Minecraft Server