[mc] Integrate rcon-cli

This commit is contained in:
Geoff Bourne 2017-04-07 19:35:15 -05:00
parent 97e9b2901c
commit 80c18004c1
2 changed files with 12 additions and 0 deletions

View file

@ -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

View file

@ -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