mirror of
https://github.com/itzg/docker-minecraft-server.git
synced 2026-04-10 07:38:53 +00:00
Compare commits
6 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
efd3427fc0 | ||
|
|
88ed017ca7 | ||
|
|
30ba3a4b78 | ||
|
|
c8380daee5 | ||
|
|
8afb1651fd | ||
|
|
9560903c80 |
@@ -18,9 +18,9 @@ RUN apk add --no-cache -U \
|
|||||||
nano \
|
nano \
|
||||||
python python-dev py2-pip
|
python python-dev py2-pip
|
||||||
|
|
||||||
RUN pip install mcstatus yq
|
RUN pip install yq
|
||||||
|
|
||||||
HEALTHCHECK --start-period=1m CMD mcstatus localhost:$SERVER_PORT ping
|
HEALTHCHECK --start-period=1m CMD mc-monitor status --host localhost --port $SERVER_PORT
|
||||||
|
|
||||||
RUN addgroup -g 1000 minecraft \
|
RUN addgroup -g 1000 minecraft \
|
||||||
&& adduser -Ss /bin/false -u 1000 -G minecraft -h /home/minecraft minecraft \
|
&& adduser -Ss /bin/false -u 1000 -G minecraft -h /home/minecraft minecraft \
|
||||||
@@ -41,11 +41,14 @@ RUN easy-add --file restify --from https://github.com/itzg/restify/releases/down
|
|||||||
ARG RCON_CLI_VER=1.4.7
|
ARG RCON_CLI_VER=1.4.7
|
||||||
RUN easy-add --file rcon-cli --from https://github.com/itzg/rcon-cli/releases/download/${RCON_CLI_VER}/rcon-cli_${RCON_CLI_VER}_linux_${ARCH}.tar.gz
|
RUN easy-add --file rcon-cli --from https://github.com/itzg/rcon-cli/releases/download/${RCON_CLI_VER}/rcon-cli_${RCON_CLI_VER}_linux_${ARCH}.tar.gz
|
||||||
|
|
||||||
|
ARG MC_MONITOR_VER=0.1.6
|
||||||
|
RUN easy-add --file mc-monitor --from https://github.com/itzg/mc-monitor/releases/download/v${MC_MONITOR_VER}/mc-monitor_${MC_MONITOR_VER}_Linux_${ARCH}.tar.gz
|
||||||
|
|
||||||
ARG MC_RUN_VER=1.3.3
|
ARG MC_RUN_VER=1.3.3
|
||||||
RUN easy-add --file mc-server-runner --from https://github.com/itzg/mc-server-runner/releases/download/${MC_RUN_VER}/mc-server-runner_${MC_RUN_VER}_linux_${ARCH}.tar.gz
|
RUN easy-add --file mc-server-runner --from https://github.com/itzg/mc-server-runner/releases/download/${MC_RUN_VER}/mc-server-runner_${MC_RUN_VER}_linux_${ARCH}.tar.gz
|
||||||
|
|
||||||
COPY mcadmin.jq /usr/share
|
COPY mcadmin.jq /usr/share
|
||||||
RUN chmod +x /usr/local/bin/*
|
COPY mcstatus /usr/local/bin
|
||||||
|
|
||||||
VOLUME ["/data","/mods","/config"]
|
VOLUME ["/data","/mods","/config"]
|
||||||
COPY server.properties /tmp/server.properties
|
COPY server.properties /tmp/server.properties
|
||||||
|
|||||||
16
mcstatus
Executable file
16
mcstatus
Executable file
@@ -0,0 +1,16 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
##### mcstatus shim for mc-monitor
|
||||||
|
# handles translating calls to
|
||||||
|
# mcstatus (host:port) (command)
|
||||||
|
# where the actual command is ignore, but is typically ping or status
|
||||||
|
|
||||||
|
addr="$1"
|
||||||
|
|
||||||
|
IFS=':'
|
||||||
|
read -a parts <<< "${addr}"
|
||||||
|
if [[ ${#parts[*]} -gt 1 ]]; then
|
||||||
|
exec mc-monitor status --host ${parts[0]} --port ${parts[1]}
|
||||||
|
else
|
||||||
|
exec mc-monitor status --host ${parts[0]}
|
||||||
|
fi
|
||||||
Reference in New Issue
Block a user