mirror of
https://github.com/itzg/docker-minecraft-server.git
synced 2026-03-23 23:12:43 +00:00
Compare commits
8 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
54d19715c7 | ||
|
|
bbe1533f91 | ||
|
|
97040f61ed | ||
|
|
55801ac11c | ||
|
|
07c32d8ee4 | ||
|
|
2e631bcbd9 | ||
|
|
c96c630fe5 | ||
|
|
f69e75cfc1 |
@@ -4,7 +4,7 @@ MAINTAINER itzg
|
|||||||
|
|
||||||
RUN apk -U add bash
|
RUN apk -U add bash
|
||||||
|
|
||||||
ENV ES_VERSION=5.2.1
|
ENV ES_VERSION=5.3.0
|
||||||
|
|
||||||
ADD https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-$ES_VERSION.tar.gz /tmp/es.tgz
|
ADD https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-$ES_VERSION.tar.gz /tmp/es.tgz
|
||||||
RUN cd /usr/share && \
|
RUN cd /usr/share && \
|
||||||
|
|||||||
@@ -181,7 +181,8 @@ To simplify all that, this image provides a `TYPE` variable to let you amongst t
|
|||||||
* `MASTER` : master-eligible, but holds no data. It is good to have three or more of these in a
|
* `MASTER` : master-eligible, but holds no data. It is good to have three or more of these in a
|
||||||
large cluster
|
large cluster
|
||||||
* `DATA` (or `NON_MASTER`) : holds data and serves search/index requests. Scale these out for elastic-y goodness.
|
* `DATA` (or `NON_MASTER`) : holds data and serves search/index requests. Scale these out for elastic-y goodness.
|
||||||
* `GATEWAY` : only operates as a client node or a "smart router". These are the ones whose HTTP port 9200 will need to be exposed
|
* `GATEWAY` (or `COORDINATING`) : only operates as a client node or a "smart router". These are the ones whose HTTP port 9200 will need to be exposed
|
||||||
|
* `INGEST` : operates only as an ingest node and is not master or data eligble
|
||||||
|
|
||||||
A [Docker Compose](https://docs.docker.com/compose/overview/) file will serve as a good example of these three node types:
|
A [Docker Compose](https://docs.docker.com/compose/overview/) file will serve as a good example of these three node types:
|
||||||
|
|
||||||
|
|||||||
@@ -29,6 +29,13 @@ services:
|
|||||||
environment:
|
environment:
|
||||||
TYPE: GATEWAY
|
TYPE: GATEWAY
|
||||||
UNICAST_HOSTS: master
|
UNICAST_HOSTS: master
|
||||||
|
ingest:
|
||||||
|
image: itzg/elasticsearch
|
||||||
|
ports:
|
||||||
|
- "9222:9200"
|
||||||
|
environment:
|
||||||
|
TYPE: INGEST
|
||||||
|
UNICAST_HOSTS: master
|
||||||
kibana:
|
kibana:
|
||||||
image: kibana
|
image: kibana
|
||||||
ports:
|
ports:
|
||||||
|
|||||||
@@ -77,15 +77,19 @@ setup_personality() {
|
|||||||
if [ -n "$TYPE" ]; then
|
if [ -n "$TYPE" ]; then
|
||||||
case $TYPE in
|
case $TYPE in
|
||||||
MASTER)
|
MASTER)
|
||||||
OPTS="$OPTS -E node.master=true -E node.data=false"
|
OPTS="$OPTS -E node.master=true -E node.data=false -E node.ingest=false"
|
||||||
;;
|
;;
|
||||||
|
|
||||||
GATEWAY)
|
GATEWAY|COORDINATING)
|
||||||
OPTS="$OPTS -E node.master=false -E node.data=false"
|
OPTS="$OPTS -E node.master=false -E node.data=false -E node.ingest=false"
|
||||||
|
;;
|
||||||
|
|
||||||
|
INGEST)
|
||||||
|
OPTS="$OPTS -E node.master=false -E node.data=false -E node.ingest=true"
|
||||||
;;
|
;;
|
||||||
|
|
||||||
DATA|NON_MASTER)
|
DATA|NON_MASTER)
|
||||||
OPTS="$OPTS -E node.master=false -E node.data=true"
|
OPTS="$OPTS -E node.master=false -E node.data=true -E node.ingest=false"
|
||||||
;;
|
;;
|
||||||
|
|
||||||
*)
|
*)
|
||||||
|
|||||||
@@ -40,6 +40,6 @@ ENTRYPOINT [ "/start" ]
|
|||||||
|
|
||||||
ENV UID=1000 GID=1000 \
|
ENV UID=1000 GID=1000 \
|
||||||
MOTD="A Minecraft Server Powered by Docker" \
|
MOTD="A Minecraft Server Powered by Docker" \
|
||||||
JVM_XX_OPTS="-XX:+UseG1GC" MAX_MEMORY="1G" \
|
JVM_XX_OPTS="-XX:+UseG1GC" MEMORY="1G" \
|
||||||
TYPE=VANILLA VERSION=LATEST FORGEVERSION=RECOMMENDED LEVEL=world PVP=true DIFFICULTY=easy \
|
TYPE=VANILLA VERSION=LATEST FORGEVERSION=RECOMMENDED LEVEL=world PVP=true DIFFICULTY=easy \
|
||||||
LEVEL_TYPE=DEFAULT GENERATOR_SETTINGS= WORLD= MODPACK= ONLINE_MODE=TRUE CONSOLE=true
|
LEVEL_TYPE=DEFAULT GENERATOR_SETTINGS= WORLD= MODPACK= ONLINE_MODE=TRUE CONSOLE=true
|
||||||
|
|||||||
@@ -608,11 +608,16 @@ By default, server checks connecting players against Minecraft's account databas
|
|||||||
|
|
||||||
### Memory Limit
|
### Memory Limit
|
||||||
|
|
||||||
By default the image declares a Java memory limit of 1 GB. That can be adjusted
|
By default, the image declares a Java initial and maximum memory limit of 1 GB. There are several
|
||||||
higher (or lower) by setting the `MAX_MEMORY` environment variable. For example,
|
ways to adjust the memory settings:
|
||||||
the following increases the memory limit to 8 GB:
|
|
||||||
|
|
||||||
docker run -e MAX_MEMORY=8G ...
|
* `MEMORY`, "1G" by default, can be used to adjust both initial (`Xms`) and max (`Xmx`)
|
||||||
|
memory settings of the JVM
|
||||||
|
* `INIT_MEMORY`, independently sets the initial heap size
|
||||||
|
* `MAX_MEMORY`, independently sets the max heap size
|
||||||
|
|
||||||
|
The values of all three are passed directly to the JVM and support format/units as
|
||||||
|
`<size>[g|G|m|M|k|K]`.
|
||||||
|
|
||||||
### /data ownership
|
### /data ownership
|
||||||
|
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
version: '3'
|
version: '3'
|
||||||
|
|
||||||
services:
|
services:
|
||||||
minecraft-server:
|
minecraft:
|
||||||
ports:
|
ports:
|
||||||
- "25570:25565"
|
- "25565:25565"
|
||||||
volumes:
|
volumes:
|
||||||
- "mcbig:/data"
|
- "mcbig:/data"
|
||||||
environment:
|
environment:
|
||||||
@@ -16,6 +16,14 @@ services:
|
|||||||
CONSOLE: "false"
|
CONSOLE: "false"
|
||||||
image: itzg/minecraft-server
|
image: itzg/minecraft-server
|
||||||
restart: always
|
restart: always
|
||||||
|
rcon:
|
||||||
|
image: itzg/rcon
|
||||||
|
ports:
|
||||||
|
- "4326:4326"
|
||||||
|
- "4327:4327"
|
||||||
|
volumes:
|
||||||
|
- "rcon:/opt/rcon-web-admin/db"
|
||||||
|
|
||||||
volumes:
|
volumes:
|
||||||
mcbig:
|
mcbig:
|
||||||
|
rcon:
|
||||||
|
|||||||
@@ -120,7 +120,7 @@ function installForge {
|
|||||||
echo "Checking Forge version information."
|
echo "Checking Forge version information."
|
||||||
case $FORGEVERSION in
|
case $FORGEVERSION in
|
||||||
RECOMMENDED)
|
RECOMMENDED)
|
||||||
wget -q -O /tmp/forge.json -sSL http://files.minecraftforge.net/maven/net/minecraftforge/forge/promotions_slim.json
|
wget -q -O /tmp/forge.json http://files.minecraftforge.net/maven/net/minecraftforge/forge/promotions_slim.json
|
||||||
FORGE_VERSION=$(cat /tmp/forge.json | jq -r ".promos[\"$norm-recommended\"]")
|
FORGE_VERSION=$(cat /tmp/forge.json | jq -r ".promos[\"$norm-recommended\"]")
|
||||||
if [ $FORGE_VERSION = null ]; then
|
if [ $FORGE_VERSION = null ]; then
|
||||||
FORGE_VERSION=$(cat /tmp/forge.json | jq -r ".promos[\"$norm-latest\"]")
|
FORGE_VERSION=$(cat /tmp/forge.json | jq -r ".promos[\"$norm-latest\"]")
|
||||||
@@ -138,7 +138,7 @@ function installForge {
|
|||||||
esac
|
esac
|
||||||
|
|
||||||
# URL format changed for 1.7.10 from 10.13.2.1300
|
# URL format changed for 1.7.10 from 10.13.2.1300
|
||||||
sorted=$( (echo $FORGE_VERSION; echo 10.13.2.1300) | sort -V | head -1)
|
sorted=$( (echo $FORGE_VERSION; echo 10.13.2.1300) | sort | head -1)
|
||||||
if [[ $norm == '1.7.10' && $sorted == '10.13.2.1300' ]]; then
|
if [[ $norm == '1.7.10' && $sorted == '10.13.2.1300' ]]; then
|
||||||
# if $FORGEVERSION >= 10.13.2.1300
|
# if $FORGEVERSION >= 10.13.2.1300
|
||||||
normForgeVersion="$norm-$FORGE_VERSION-$norm"
|
normForgeVersion="$norm-$FORGE_VERSION-$norm"
|
||||||
@@ -189,7 +189,7 @@ function installFTB {
|
|||||||
echo "Unpacking FTB server modpack ${srv_modpack} ..."
|
echo "Unpacking FTB server modpack ${srv_modpack} ..."
|
||||||
local ftb_dir=/data/FeedTheBeast
|
local ftb_dir=/data/FeedTheBeast
|
||||||
mkdir -p ${ftb_dir}
|
mkdir -p ${ftb_dir}
|
||||||
unzip -u -o ${srv_modpack} -d ${ftb_dir}
|
unzip -o ${srv_modpack} -d ${ftb_dir}
|
||||||
cp -f /data/eula.txt ${ftb_dir}/eula.txt
|
cp -f /data/eula.txt ${ftb_dir}/eula.txt
|
||||||
FTB_SERVER_START=${ftb_dir}/ServerStart.sh
|
FTB_SERVER_START=${ftb_dir}/ServerStart.sh
|
||||||
chmod a+x ${FTB_SERVER_START}
|
chmod a+x ${FTB_SERVER_START}
|
||||||
@@ -491,10 +491,10 @@ else
|
|||||||
EXTRA_ARGS=""
|
EXTRA_ARGS=""
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ ! -z $MAX_MEMORY ]]; then
|
# put these prior JVM_OPTS at the end to give any memory settings there higher precedence
|
||||||
# put prior JVM_OPTS at the end to give any memory settings there higher precedence
|
echo "Setting initial memory to ${INIT_MEMORY:-${MEMORY}} and max to ${MAX_MEMORY:-${MEMORY}}"
|
||||||
JVM_OPTS="-Xms${MAX_MEMORY} -Xmx${MAX_MEMORY} ${JVM_OPTS}"
|
JVM_OPTS="-Xms${INIT_MEMORY:-${MEMORY}} -Xmx${MAX_MEMORY:-${MEMORY}} ${JVM_OPTS}"
|
||||||
fi
|
|
||||||
set -x
|
set -x
|
||||||
if [[ ${TYPE} == "FEED-THE-BEAST" ]]; then
|
if [[ ${TYPE} == "FEED-THE-BEAST" ]]; then
|
||||||
echo "Running FTB server modpack start ..."
|
echo "Running FTB server modpack start ..."
|
||||||
|
|||||||
Reference in New Issue
Block a user