mirror of
https://github.com/itzg/docker-minecraft-server.git
synced 2026-02-17 15:13:55 +00:00
Compare commits
74 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5afd98edd8 | ||
|
|
8b9051d72e | ||
|
|
d6392f3aa9 | ||
|
|
fe808be91b | ||
|
|
2cab10e906 | ||
|
|
7f39d1f22e | ||
|
|
a9184368c1 | ||
|
|
caf2fc2ab6 | ||
|
|
5dd8141e5e | ||
|
|
2ff28675d4 | ||
|
|
519bd986b5 | ||
|
|
e41efba176 | ||
|
|
0502813496 | ||
|
|
932a6828f9 | ||
|
|
d176ef3f6a | ||
|
|
deb98268f6 | ||
|
|
e1531c3237 | ||
|
|
47af45a430 | ||
|
|
0195b42eea | ||
|
|
f875af5cdb | ||
|
|
32a918b902 | ||
|
|
d09a56075f | ||
|
|
e261fae348 | ||
|
|
5b8668d73f | ||
|
|
123292b56b | ||
|
|
0e0828f47f | ||
|
|
532c9fa69a | ||
|
|
e509563b10 | ||
|
|
899f31917c | ||
|
|
e6ca9a1c6d | ||
|
|
24c68b9c2c | ||
|
|
2891e1ac3e | ||
|
|
da9618c08b | ||
|
|
cb6643a345 | ||
|
|
71527b87c1 | ||
|
|
df25a22634 | ||
|
|
5c6a2cf44f | ||
|
|
536a7f6095 | ||
|
|
df9e725baf | ||
|
|
156716a7d8 | ||
|
|
0876ef7704 | ||
|
|
5c3ea25ff3 | ||
|
|
bd8e0cf5d2 | ||
|
|
1d5c4e3b0b | ||
|
|
6a565692a0 | ||
|
|
cf68446a00 | ||
|
|
c4a92f6706 | ||
|
|
7bb397a031 | ||
|
|
d86f034e96 | ||
|
|
20385507d8 | ||
|
|
91def1176d | ||
|
|
2e03ee4197 | ||
|
|
e8dd60a831 | ||
|
|
dc15094b8a | ||
|
|
fc807429e4 | ||
|
|
5ec21fc0ba | ||
|
|
3a0a8a9ced | ||
|
|
b9b05dbdfc | ||
|
|
179e72cda0 | ||
|
|
2b9514ab0b | ||
|
|
8a04a9f72e | ||
|
|
3a7af8e8d6 | ||
|
|
615d12bce3 | ||
|
|
72d055ac19 | ||
|
|
80c18004c1 | ||
|
|
97e9b2901c | ||
|
|
027d94cc77 | ||
|
|
66261af03d | ||
|
|
290e2c734a | ||
|
|
54d19715c7 | ||
|
|
bbe1533f91 | ||
|
|
97040f61ed | ||
|
|
55801ac11c | ||
|
|
07c32d8ee4 |
10
README.md
10
README.md
@@ -1,6 +1,10 @@
|
||||
dockerfiles
|
||||
===========
|
||||
|
||||
Contains the various Dockerfile definitions I'm maintaining.
|
||||
This repository contains the various Dockerfile definitions I'm maintaining.
|
||||
|
||||
[](https://gitter.im/itzg/dockerfiles?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge)
|
||||
|
||||
### Discontinued
|
||||
|
||||
##### Cassandra
|
||||
|
||||
I have found the [official image](https://hub.docker.com/_/cassandra/) to be quite sufficient
|
||||
|
||||
2
build
2
build
@@ -5,10 +5,8 @@ pkgs="$pkgs minecraft-server"
|
||||
pkgs="$pkgs elasticsearch"
|
||||
pkgs="$pkgs kibana"
|
||||
pkgs="$pkgs titan-gremlin"
|
||||
pkgs="$pkgs cassandra"
|
||||
|
||||
for p in $pkgs
|
||||
do
|
||||
docker build -t itzg/$p $p
|
||||
done
|
||||
|
||||
|
||||
@@ -1,26 +0,0 @@
|
||||
FROM java:openjdk-8u72-jdk
|
||||
|
||||
MAINTAINER itzg
|
||||
|
||||
ENV CASSANDRA_VERSION 2.2.8
|
||||
|
||||
ADD http://apache.mirrors.pair.com/cassandra/$CASSANDRA_VERSION/apache-cassandra-$CASSANDRA_VERSION-bin.tar.gz /tmp/apache-cassandra.tgz
|
||||
RUN tar -C /opt -zxf /tmp/apache-cassandra.tgz && \
|
||||
rm /tmp/apache-cassandra.tgz
|
||||
|
||||
|
||||
RUN mv /opt/apache-cassandra-$CASSANDRA_VERSION /opt/cassandra
|
||||
ENV CASSANDRA_HOME /opt/cassandra
|
||||
ENV CASSANDRA_CONF /conf
|
||||
ENV CASSANDRA_DATA /data
|
||||
WORKDIR $CASSANDRA_HOME
|
||||
|
||||
RUN ln -s $CASSANDRA_HOME/bin/* /usr/local/bin
|
||||
VOLUME ["/data","/conf"]
|
||||
|
||||
EXPOSE 9042 9160 7000 7001
|
||||
|
||||
ADD cassandra.in.sh $CASSANDRA_HOME/cassandra.in.sh
|
||||
RUN mv $CASSANDRA_HOME/bin/cassandra.in.sh $CASSANDRA_HOME/bin/orig.cassandra.in.sh
|
||||
|
||||
CMD ["/opt/cassandra/bin/cassandra", "-f"]
|
||||
@@ -1,9 +0,0 @@
|
||||
Yet another Cassandra image, but this one got container and non-container access right.
|
||||
|
||||
# Basic Usage
|
||||
|
||||
To support access from both Docker containers and external, non-Docker clients:
|
||||
|
||||
docker run -d --name cassandra -e PUBLISH_AS=192.168.59.103 -p 9160:9160 itzg/cassandra
|
||||
|
||||
replacing `192.168.59.103` with your Docker host's LAN IP address.
|
||||
@@ -1,24 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
cassYml=$CASSANDRA_HOME/conf/cassandra.yaml
|
||||
|
||||
privateAddr=$(hostname -i)
|
||||
|
||||
seeds=${SEEDS:-${PUBLISH_AS:-$privateAddr}}
|
||||
|
||||
sed -i -e "s/- seeds:.*/- seeds: \"$seeds\"/" \
|
||||
-e "s/listen_address:.*/listen_address: $privateAddr/" \
|
||||
-e "s/rpc_address:.*/rpc_address: $privateAddr/" \
|
||||
-e "s/start_rpc:.*/start_rpc: true/" \
|
||||
-e "s#- /var/lib/cassandra/data#- $CASSANDRA_DATA#" \
|
||||
$cassYml
|
||||
|
||||
if [ -n "$PUBLISH_AS" ]; then
|
||||
sed -i -e "s/\(\s*#\)\?\s*broadcast_address:.*/broadcast_address: $PUBLISH_AS/" $cassYml
|
||||
fi
|
||||
|
||||
# Copy over our tweaked files, but non-clobbering to let user have ultimate control
|
||||
cp -rn $CASSANDRA_HOME/conf/* $CASSANDRA_CONF
|
||||
|
||||
# source the original
|
||||
. $CASSANDRA_HOME/bin/orig.cassandra.in.sh
|
||||
@@ -1,15 +1,21 @@
|
||||
FROM openjdk:8u111-jre-alpine
|
||||
FROM openjdk:8u121-jre-alpine
|
||||
|
||||
MAINTAINER itzg
|
||||
LABEL maintainer "itzg"
|
||||
|
||||
RUN apk -U add bash
|
||||
|
||||
ENV ES_VERSION=5.2.2
|
||||
ARG ES_VERSION=5.5.1
|
||||
# avoid conflicts with debian host systems when mounting to host volume
|
||||
ARG DEFAULT_ES_USER_UID=1100
|
||||
|
||||
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
|
||||
# need to adapt to both Docker's new remote-unpack-ADD behavior and the old behavior
|
||||
RUN cd /usr/share && \
|
||||
tar xf /tmp/es.tgz && \
|
||||
rm /tmp/es.tgz
|
||||
if [ -f /tmp/elasticsearch-$ES_VERSION.tar.gz ]; then \
|
||||
tar xf /tmp/elasticsearch-$ES_VERSION.tar.gz; \
|
||||
else mv /tmp/elasticsearch-${ES_VERSION} /usr/share; \
|
||||
fi && \
|
||||
rm -f /tmp/elasticsearch-$ES_VERSION.tar.gz
|
||||
|
||||
EXPOSE 9200 9300
|
||||
|
||||
@@ -17,9 +23,10 @@ HEALTHCHECK --timeout=5s CMD wget -q -O - http://$HOSTNAME:9200/_cat/health
|
||||
|
||||
ENV ES_HOME=/usr/share/elasticsearch-$ES_VERSION \
|
||||
DEFAULT_ES_USER=elasticsearch \
|
||||
DEFAULT_ES_USER_UID=$DEFAULT_ES_USER_UID \
|
||||
ES_JAVA_OPTS="-Xms1g -Xmx1g"
|
||||
|
||||
RUN adduser -S -s /bin/sh $DEFAULT_ES_USER
|
||||
RUN adduser -S -s /bin/sh -u $DEFAULT_ES_USER_UID $DEFAULT_ES_USER
|
||||
|
||||
VOLUME ["/data","/conf"]
|
||||
|
||||
|
||||
@@ -181,12 +181,14 @@ 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
|
||||
large cluster
|
||||
* `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
|
||||
* `NON_DATA` : performs all duties except holding data
|
||||
* `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 eligible
|
||||
|
||||
A [Docker Compose](https://docs.docker.com/compose/overview/) file will serve as a good example of these three node types:
|
||||
|
||||
```
|
||||
version: '2'
|
||||
version: '3'
|
||||
|
||||
services:
|
||||
gateway:
|
||||
@@ -209,6 +211,14 @@ services:
|
||||
environment:
|
||||
UNICAST_HOSTS: master,gateway
|
||||
TYPE: DATA
|
||||
|
||||
kibana:
|
||||
image: kibana
|
||||
ports:
|
||||
- "5601:5601"
|
||||
environment:
|
||||
ELASTICSEARCH_URL: http://gateway:9200
|
||||
|
||||
```
|
||||
|
||||
## Minimum Master Nodes
|
||||
|
||||
35
elasticsearch/docker-compose-3x1GB.yml
Normal file
35
elasticsearch/docker-compose-3x1GB.yml
Normal file
@@ -0,0 +1,35 @@
|
||||
# This composition is known to work on a Swarm cluster consisting of
|
||||
# 3 VM nodes with 1GB allocated to each.
|
||||
version: '3'
|
||||
|
||||
services:
|
||||
master:
|
||||
image: itzg/elasticsearch
|
||||
environment:
|
||||
UNICAST_HOSTS: master
|
||||
MIN_MASTERS: 1
|
||||
ES_JAVA_OPTS: -Xms756m -Xmx756m
|
||||
TYPE: NON_DATA
|
||||
ports:
|
||||
- "9200:9200"
|
||||
- "9300:9300"
|
||||
deploy:
|
||||
replicas: 1
|
||||
update_config:
|
||||
parallelism: 1
|
||||
data:
|
||||
image: itzg/elasticsearch
|
||||
deploy:
|
||||
mode: global
|
||||
update_config:
|
||||
parallelism: 1
|
||||
environment:
|
||||
TYPE: DATA
|
||||
UNICAST_HOSTS: master
|
||||
ES_JAVA_OPTS: -Xms512m -Xmx512m
|
||||
kibana:
|
||||
image: kibana
|
||||
ports:
|
||||
- "5601:5601"
|
||||
environment:
|
||||
ELASTICSEARCH_URL: http://master:9200
|
||||
35
elasticsearch/docker-compose-localbuild.yml
Normal file
35
elasticsearch/docker-compose-localbuild.yml
Normal file
@@ -0,0 +1,35 @@
|
||||
version: '3'
|
||||
|
||||
services:
|
||||
master:
|
||||
build: .
|
||||
environment:
|
||||
TYPE: MASTER
|
||||
UNICAST_HOSTS: master
|
||||
MIN_MASTERS: 1
|
||||
data:
|
||||
build: .
|
||||
environment:
|
||||
TYPE: DATA
|
||||
UNICAST_HOSTS: master
|
||||
gateway:
|
||||
build: .
|
||||
ports:
|
||||
- "9200:9200"
|
||||
- "9300:9300"
|
||||
environment:
|
||||
TYPE: GATEWAY
|
||||
UNICAST_HOSTS: master
|
||||
ingest:
|
||||
build: .
|
||||
ports:
|
||||
- "9222:9200"
|
||||
environment:
|
||||
TYPE: INGEST
|
||||
UNICAST_HOSTS: master
|
||||
kibana:
|
||||
image: kibana:5.5.1
|
||||
ports:
|
||||
- "5601:5601"
|
||||
environment:
|
||||
ELASTICSEARCH_URL: http://gateway:9200
|
||||
21
elasticsearch/docker-compose-min.yml
Normal file
21
elasticsearch/docker-compose-min.yml
Normal file
@@ -0,0 +1,21 @@
|
||||
version: '3'
|
||||
|
||||
services:
|
||||
master:
|
||||
image: itzg/elasticsearch
|
||||
environment:
|
||||
UNICAST_HOSTS: master
|
||||
MIN_MASTERS: 1
|
||||
ports:
|
||||
- "9200:9200"
|
||||
- "9300:9300"
|
||||
deploy:
|
||||
replicas: 1
|
||||
update_config:
|
||||
parallelism: 1
|
||||
kibana:
|
||||
image: kibana
|
||||
ports:
|
||||
- "5601:5601"
|
||||
environment:
|
||||
ELASTICSEARCH_URL: http://master:9200
|
||||
@@ -29,6 +29,13 @@ services:
|
||||
environment:
|
||||
TYPE: GATEWAY
|
||||
UNICAST_HOSTS: master
|
||||
ingest:
|
||||
image: itzg/elasticsearch
|
||||
ports:
|
||||
- "9222:9200"
|
||||
environment:
|
||||
TYPE: INGEST
|
||||
UNICAST_HOSTS: master
|
||||
kibana:
|
||||
image: kibana
|
||||
ports:
|
||||
|
||||
@@ -20,7 +20,18 @@ discoverIpFromLink() {
|
||||
}
|
||||
|
||||
discoverAllGlobalIps() {
|
||||
ips=`ipaddr show scope global|awk '$1 == "inet" { if (!match($2,"/32")) { gsub("/.*","",$2) ; addrs[length(addrs)] = $2 } } END { for (i in addrs) { if (i>0) printf "," ; printf addrs[i] } }'`
|
||||
if [ ${#IGNORE_NETWORK} -eq 0 ]
|
||||
then
|
||||
IGNORE_NETWORK='999.999.999.999'
|
||||
fi
|
||||
printf "Finding IPs"
|
||||
while [ ${#ips} -eq 0 ]
|
||||
do
|
||||
printf "."
|
||||
ips=`ipaddr show scope global| grep -v "inet ${IGNORE_NETWORK}" | awk '$1 == "inet" { if (!match($2,"/32")) { gsub("/.*","",$2) ; addrs[length(addrs)] = $2 } } END { for (i in addrs) { if (i>0) printf "," ; printf addrs[i] } }'`
|
||||
sleep 1
|
||||
done
|
||||
echo " found! $ips"
|
||||
OPTS="$OPTS -E network.host=$ips"
|
||||
}
|
||||
|
||||
@@ -77,15 +88,27 @@ setup_personality() {
|
||||
if [ -n "$TYPE" ]; then
|
||||
case $TYPE in
|
||||
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)
|
||||
OPTS="$OPTS -E node.master=false -E node.data=false"
|
||||
GATEWAY|COORDINATING)
|
||||
OPTS="$OPTS -E node.master=false -E node.data=false -E node.ingest=false"
|
||||
;;
|
||||
|
||||
DATA|NON_MASTER)
|
||||
OPTS="$OPTS -E node.master=false -E node.data=true"
|
||||
INGEST)
|
||||
OPTS="$OPTS -E node.master=false -E node.data=false -E node.ingest=true"
|
||||
;;
|
||||
|
||||
DATA)
|
||||
OPTS="$OPTS -E node.master=false -E node.data=true -E node.ingest=false"
|
||||
;;
|
||||
|
||||
NON_MASTER)
|
||||
OPTS="$OPTS -E node.master=false -E node.data=true -E node.ingest=true"
|
||||
;;
|
||||
|
||||
NON_DATA)
|
||||
OPTS="$OPTS -E node.master=true -E node.data=false -E node.ingest=true"
|
||||
;;
|
||||
|
||||
*)
|
||||
|
||||
@@ -1,18 +1,18 @@
|
||||
FROM java:8
|
||||
|
||||
MAINTAINER itzg
|
||||
|
||||
LABEL maintainer "itzg"
|
||||
|
||||
ENV GITBLIT_VERSION 1.7.1
|
||||
|
||||
|
||||
RUN wget -qO /tmp/gitblit.tgz http://dl.bintray.com/gitblit/releases/gitblit-$GITBLIT_VERSION.tar.gz
|
||||
|
||||
|
||||
RUN tar -C /opt -xvf /tmp/gitblit.tgz && \
|
||||
rm /tmp/gitblit.tgz
|
||||
|
||||
|
||||
VOLUME ["/data"]
|
||||
|
||||
|
||||
ADD start.sh /start
|
||||
|
||||
|
||||
ENV GITBLIT_PATH=/opt/gitblit-${GITBLIT_VERSION} \
|
||||
GITBLIT_HTTPS_PORT=443 \
|
||||
GITBLIT_HTTP_PORT=80 \
|
||||
@@ -20,7 +20,7 @@ ENV GITBLIT_PATH=/opt/gitblit-${GITBLIT_VERSION} \
|
||||
GITBLIT_ADMIN_USER=admin \
|
||||
GITBLIT_INITIAL_REPO=
|
||||
WORKDIR $GITBLIT_PATH
|
||||
|
||||
|
||||
EXPOSE 80 443
|
||||
|
||||
|
||||
ENTRYPOINT ["/start"]
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
FROM itzg/ubuntu-openjdk-7
|
||||
|
||||
MAINTAINER itzg
|
||||
LABEL maintainer "itzg"
|
||||
|
||||
RUN apt-get install -y curl unzip
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
FROM ubuntu:trusty
|
||||
|
||||
MAINTAINER itzg
|
||||
LABEL maintainer "itzg"
|
||||
|
||||
ENV APT_GET_UPDATE 2014-09-18
|
||||
|
||||
@@ -21,4 +21,3 @@ EXPOSE 4000
|
||||
|
||||
ADD start.sh /start
|
||||
CMD ["/start"]
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
FROM java:openjdk-8u102-jdk
|
||||
|
||||
MAINTAINER itzg
|
||||
LABEL maintainer "itzg"
|
||||
|
||||
RUN apt-get update && \
|
||||
DEBIAN_FRONTEND=noninteractive apt-get install -y \
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
FROM openjdk:8u111-jre
|
||||
|
||||
MAINTAINER itzg
|
||||
LABEL maintainer "itzg"
|
||||
|
||||
ENV KIBANA_VERSION 5.1.2
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
FROM itzg/ubuntu-openjdk-7
|
||||
|
||||
MAINTAINER itzg
|
||||
LABEL maintainer "itzg"
|
||||
|
||||
ENV LOGSTASH_VERSION 1.5.0-1
|
||||
|
||||
|
||||
@@ -1,21 +1,24 @@
|
||||
FROM alpine
|
||||
FROM openjdk:8u131-jre-alpine
|
||||
|
||||
LABEL maintainer "itzg"
|
||||
|
||||
MAINTAINER itzg
|
||||
|
||||
RUN echo "http://dl-3.alpinelinux.org/alpine/v3.5/community/" >> /etc/apk/repositories &&\
|
||||
apk update && \
|
||||
apk add \
|
||||
openjdk8-jre-base \
|
||||
RUN apk add -U \
|
||||
openssl \
|
||||
imagemagick \
|
||||
lsof \
|
||||
su-exec \
|
||||
bash \
|
||||
curl \
|
||||
git \
|
||||
jq &&\
|
||||
jq \
|
||||
mysql-client \
|
||||
python python-dev py2-pip && \
|
||||
rm -rf /var/cache/apk/*
|
||||
|
||||
RUN pip install mcstatus
|
||||
|
||||
HEALTHCHECK CMD mcstatus localhost ping
|
||||
|
||||
RUN addgroup -g 1000 minecraft \
|
||||
&& adduser -Ss /bin/false -u 1000 -G minecraft -h /home/minecraft minecraft \
|
||||
&& mkdir /data \
|
||||
@@ -27,6 +30,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.3/rcon-cli_linux_amd64 /usr/local/bin/rcon-cli
|
||||
COPY start.sh /start
|
||||
COPY start-minecraft.sh /start-minecraft
|
||||
COPY mcadmin.jq /usr/share
|
||||
@@ -40,6 +44,7 @@ ENTRYPOINT [ "/start" ]
|
||||
|
||||
ENV UID=1000 GID=1000 \
|
||||
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 \
|
||||
ENABLE_RCON=true RCON_PORT=25575 RCON_PASSWORD=minecraft \
|
||||
LEVEL_TYPE=DEFAULT GENERATOR_SETTINGS= WORLD= MODPACK= ONLINE_MODE=TRUE CONSOLE=true
|
||||
|
||||
1
minecraft-server/Minecraft server containment.xml
Normal file
1
minecraft-server/Minecraft server containment.xml
Normal file
@@ -0,0 +1 @@
|
||||
<mxfile userAgent="Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/57.0.2987.110 Safari/537.36" version="6.4.4" editor="www.draw.io" type="github"><diagram name="Page-1">1VVNc5swEP01HDMDUiDOMbGd5pK2Ux96VkGAxgJRIRvcX9+VWD40ODOZ1j0Uz9jS2w+t3ts1Ad1W/SfNmvJNZVwGJMz6gO4CQjZRCN8WuAxA8vgwAIUW2QBFM3AQvziCGFecRMZbz9EoJY1ofDBVdc1T42FMa9X5brmS/qkNK/gKOKRMrtHvIjMlolEYzoZXLooSj97EaPjB0mOh1anG8wJCc/cM5oqNudC/LVmmugVE9wHdaqXMsKr6LZeW2pG2Ie7lHetUt+a1+UgAGQLOTJ74WHEiIfQ5E2dbn7kgJ8nPky3q2fDe3DEpijqgT+AheW5mK6wK/HVZ2obVI7ZT6ZFrCHlVrRkdoLSlzwJ2BYwo8WohXSkMPzQstfsOWhCcSlNJ2EX21JFVu8mFlFsllXahdJ/YD+Bnro0AyZ+Gu+yMslnwZjt3LVd/KurCpgptLlWbA5aBXNs0vH+X/mgSFWaFq4obfQEXDKDYBhd/2809RzeIlYt2mxwZ9nkxZZ61hgXKfV16upK+EjBMmuXmruX67KSCATMMYL2SwDU5z5DkvxAE52NNvdHqyBeOoXs8UWIbplP8A3ES3UCVja/K41oVEl5RJYpuoMr9SpU34B+Qr0rD0ITD0JE4TuI/nopwLcKLexYi6OFet6CT3Pt8TjwtCI3IFUJv0eXxis9v2y+fr/D58P/yGf87PmE7v4ycbfHCp/vf</diagram></mxfile>
|
||||
@@ -35,6 +35,24 @@ 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 -i mc rcon-cli
|
||||
```
|
||||
|
||||
Note: The `-i` is required for interactive use of rcon-cli.
|
||||
|
||||
To run a simple, one-shot command, such as stopping a Minecraft server, pass the command as
|
||||
arguments to `rcon-cli`, such as:
|
||||
|
||||
```
|
||||
docker exec mc rcon-cli stop
|
||||
```
|
||||
|
||||
_The `-i` is not needed in this case._
|
||||
|
||||
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
|
||||
@@ -99,6 +117,34 @@ or a specific version:
|
||||
|
||||
docker run -d -e VERSION=1.7.9 ...
|
||||
|
||||
## Healthcheck
|
||||
|
||||
This image contains [Dinnerbone's mcstatus](https://github.com/Dinnerbone/mcstatus) and uses
|
||||
its `ping` command to continually check on the container's. That can be observed
|
||||
from the `STATUS` column of `docker ps`
|
||||
|
||||
```
|
||||
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
|
||||
b418af073764 mc "/start" 43 seconds ago Up 41 seconds (healthy) 0.0.0.0:25565->25565/tcp, 25575/tcp mc
|
||||
```
|
||||
|
||||
You can also query the container's health in a script friendly way:
|
||||
|
||||
```
|
||||
> docker container inspect -f "{{.State.Health.Status}}" mc
|
||||
healthy
|
||||
```
|
||||
|
||||
Finally, since `mcstatus` is on the `PATH` you can exec into the container
|
||||
and use mcstatus directly and invoke any of its other commands:
|
||||
|
||||
```
|
||||
> docker exec mc mcstatus localhost status
|
||||
version: v1.12 (protocol 335)
|
||||
description: "{u'text': u'A Minecraft Server Powered by Docker'}"
|
||||
players: 0/20 No players online
|
||||
```
|
||||
|
||||
## Running a Forge Server
|
||||
|
||||
Enable Forge server mode by adding a `-e TYPE=FORGE` to your command-line.
|
||||
@@ -109,6 +155,20 @@ but you can also choose to run a specific version with `-e FORGEVERSION=10.13.4.
|
||||
-e TYPE=FORGE -e FORGEVERSION=10.13.4.1448 \
|
||||
-p 25565:25565 -e EULA=TRUE --name mc itzg/minecraft-server
|
||||
|
||||
To use a pre-downloaded Forge installer, place it in the attached `/data` directory and
|
||||
specify the name of the installer file with `FORGE_INSTALLER`, such as:
|
||||
|
||||
$ docker run -d -v /path/on/host:/data ... \
|
||||
-e FORGE_INSTALLER=forge-1.11.2-13.20.0.2228-installer.jar ...
|
||||
|
||||
To download a Forge installer from a custom location, such as your own file repository, specify
|
||||
the URL with `FORGE_INSTALLER_URL`, such as:
|
||||
|
||||
$ docker run -d -v /path/on/host:/data ... \
|
||||
-e FORGE_INSTALLER_URL=http://HOST/forge-1.11.2-13.20.0.2228-installer.jar ...
|
||||
|
||||
In both of the cases above, there is no need for the `VERSION` or `FORGEVERSION` variables.
|
||||
|
||||
In order to add mods, you have two options.
|
||||
|
||||
### Using the /data volume
|
||||
@@ -159,6 +219,10 @@ Enable Bukkit/Spigot server mode by adding a `-e TYPE=BUKKIT -e VERSION=1.8` or
|
||||
-e TYPE=SPIGOT -e VERSION=1.8 \
|
||||
-p 25565:25565 -e EULA=TRUE --name mc itzg/minecraft-server
|
||||
|
||||
If you are hosting your own copy of Bukkit/Spigot you can override the download URLs with:
|
||||
* -e BUKKIT_DOWNLOAD_URL=<url>
|
||||
* -e SPIGOT_DOWNLOAD_URL=<url>
|
||||
|
||||
You can build spigot from source by adding `-e BUILD_FROM_SOURCE=true`
|
||||
|
||||
__NOTE: to avoid pegging the CPU when running Spigot,__ you will need to
|
||||
@@ -224,6 +288,9 @@ pass `--noconsole` at the very end of the command line and not use `-it`. For ex
|
||||
-e TYPE=PAPER -e VERSION=1.9.4 \
|
||||
-p 25565:25565 -e EULA=TRUE --name mc itzg/minecraft-server --noconsole
|
||||
|
||||
If you are hosting your own copy of PaperSpigot you can override the download URL with:
|
||||
* -e PAPER_DOWNLOAD_URL=<url>
|
||||
|
||||
You can install Bukkit plugins in two ways...
|
||||
|
||||
### Using the /data volume
|
||||
@@ -282,6 +349,13 @@ Now you can add a `-e FTB_SERVER_MOD=name_of_modpack.zip` to your command-line.
|
||||
-e FTB_SERVER_MOD=FTBPresentsSkyfactory3Server_3.0.6.zip \
|
||||
-p 25565:25565 -e EULA=TRUE --name mc itzg/minecraft-server
|
||||
|
||||
Instead of explicitly downloading a modpack from the Feed the Beast site, you
|
||||
can you set `FTB_SERVER_MOD` to the **server** URL of a modpack, such as
|
||||
|
||||
$ docker run ... \
|
||||
-e TYPE=FTB \
|
||||
-e FTB_SERVER_MOD=https://www.feed-the-beast.com/projects/ftb-infinity-lite-1-10/files/2402889
|
||||
|
||||
### Using the /data volume
|
||||
|
||||
You must use a persistent `/data` mount for this type of server.
|
||||
@@ -349,7 +423,7 @@ minecraft-server:
|
||||
|
||||
and in the same directory as that file run
|
||||
|
||||
docker-compose -d up
|
||||
docker-compose up -d
|
||||
|
||||
Now, go play...or adjust the `environment` section to configure
|
||||
this server instance.
|
||||
@@ -598,6 +672,20 @@ To use this option pass the environment variable `MODPACK`, such as
|
||||
top level of the zip archive. Make sure the jars are compatible with the
|
||||
particular `TYPE` of server you are running.
|
||||
|
||||
### Remove old mods/plugins
|
||||
|
||||
When the option above is specified (`MODPACK`) you can also instruct script to
|
||||
delete old mods/plugins prior to installing new ones. This behaviour is desirable
|
||||
in case you want to upgrade mods/plugins from downloaded zip file.
|
||||
To use this option pass the environment variable `REMOVE_OLD_MODS="TRUE"`, such as
|
||||
|
||||
docker run -d -e REMOVE_OLD_MODS="TRUE" -e MODPACK=http://www.example.com/mods/modpack.zip ...
|
||||
|
||||
**NOTE:** This option will be taken into account only when option `MODPACK` is also used.
|
||||
|
||||
**WARNING:** All content of the `mods` or `plugins` directory will be deleted
|
||||
before unpacking new content from the zip file.
|
||||
|
||||
### Online mode
|
||||
|
||||
By default, server checks connecting players against Minecraft's account database. If you want to create an offline server or your server is not connected to the internet, you can disable the server to try connecting to minecraft.net to authenticate players with environment variable `ONLINE_MODE`, like this
|
||||
@@ -608,11 +696,16 @@ By default, server checks connecting players against Minecraft's account databas
|
||||
|
||||
### Memory Limit
|
||||
|
||||
By default the image declares a Java memory limit of 1 GB. That can be adjusted
|
||||
higher (or lower) by setting the `MAX_MEMORY` environment variable. For example,
|
||||
the following increases the memory limit to 8 GB:
|
||||
By default, the image declares a Java initial and maximum memory limit of 1 GB. There are several
|
||||
ways to adjust the memory settings:
|
||||
|
||||
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
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
.[] |
|
||||
select(.elements | length > 1) |
|
||||
select(.elements[].elements[] | select(.class == "version" and .text == $version)) |
|
||||
.elements[].elements[] |
|
||||
.elements[].elements[] |
|
||||
select(.class|contains("server-jar")) |
|
||||
.elements[] | select(.name="a") |
|
||||
.href
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
#!/bin/bash
|
||||
|
||||
shopt -s nullglob
|
||||
|
||||
#umask 002
|
||||
export HOME=/data
|
||||
|
||||
@@ -18,21 +20,23 @@ if [ ! -e /data/eula.txt ]; then
|
||||
fi
|
||||
fi
|
||||
|
||||
SERVER_PROPERTIES=/data/server.properties
|
||||
FTB_DIR=/data/FeedTheBeast
|
||||
VERSIONS_JSON=https://launchermeta.mojang.com/mc/game/version_manifest.json
|
||||
|
||||
echo "Checking version information."
|
||||
case "X$VERSION" in
|
||||
X|XLATEST|Xlatest)
|
||||
VANILLA_VERSION=`wget -O - -q $VERSIONS_JSON | jq -r '.latest.release'`
|
||||
VANILLA_VERSION=`curl -fsSL $VERSIONS_JSON | jq -r '.latest.release'`
|
||||
;;
|
||||
XSNAPSHOT|Xsnapshot)
|
||||
VANILLA_VERSION=`wget -O - -q $VERSIONS_JSON | jq -r '.latest.snapshot'`
|
||||
VANILLA_VERSION=`curl -fsSL $VERSIONS_JSON | jq -r '.latest.snapshot'`
|
||||
;;
|
||||
X[1-9]*)
|
||||
VANILLA_VERSION=$VERSION
|
||||
;;
|
||||
*)
|
||||
VANILLA_VERSION=`wget -O - -q $VERSIONS_JSON | jq -r '.latest.release'`
|
||||
VANILLA_VERSION=`curl -fsSL $VERSIONS_JSON | jq -r '.latest.release'`
|
||||
;;
|
||||
esac
|
||||
|
||||
@@ -56,28 +60,32 @@ function downloadSpigot {
|
||||
case "$TYPE" in
|
||||
*BUKKIT|*bukkit)
|
||||
match="Craftbukkit"
|
||||
|
||||
downloadUrl=${BUKKIT_DOWNLOAD_URL}
|
||||
;;
|
||||
*)
|
||||
match="Spigot"
|
||||
downloadUrl=${SPIGOT_DOWNLOAD_URL}
|
||||
;;
|
||||
esac
|
||||
|
||||
downloadUrl=$(restify --class=jar-div https://mcadmin.net/ | \
|
||||
jq --arg version "$match $VANILLA_VERSION" -r -f /usr/share/mcadmin.jq)
|
||||
if [[ -n $downloadUrl ]]; then
|
||||
echo "Downloading $match"
|
||||
wget -q -O $SERVER "$downloadUrl"
|
||||
status=$?
|
||||
if [ $status != 0 ]; then
|
||||
echo "ERROR: failed to download from $downloadUrl due to (error code was $status)"
|
||||
exit 3
|
||||
if [[ -z $downloadUrl ]]; then
|
||||
downloadUrl=$(restify --class=jar-div https://mcadmin.net/ | \
|
||||
jq --arg version "$match $VANILLA_VERSION" -r -f /usr/share/mcadmin.jq)
|
||||
if [[ -z $downloadUrl ]]; then
|
||||
echo "ERROR: Version $VANILLA_VERSION is not supported for $TYPE"
|
||||
echo " Refer to https://mcadmin.net/ for supported versions"
|
||||
exit 2
|
||||
fi
|
||||
else
|
||||
echo "ERROR: Version $VANILLA_VERSION is not supported for $TYPE"
|
||||
echo " Refer to https://mcadmin.net/ for supported versions"
|
||||
exit 2
|
||||
fi
|
||||
|
||||
echo "Downloading $match"
|
||||
curl -kfsSL -o $SERVER "$downloadUrl"
|
||||
status=$?
|
||||
if [ ! -f $SERVER ]; then
|
||||
echo "ERROR: failed to download from $downloadUrl (status=$status)"
|
||||
exit 3
|
||||
fi
|
||||
|
||||
}
|
||||
|
||||
function downloadPaper {
|
||||
@@ -98,11 +106,11 @@ function downloadPaper {
|
||||
esac
|
||||
|
||||
if [ $build != "nosupp" ]; then
|
||||
downloadUrl="https://ci.destroystokyo.com/job/PaperSpigot/$build/artifact/paperclip.jar"
|
||||
wget -q -O $SERVER "$downloadUrl"
|
||||
status=$?
|
||||
if [ $status != 0 ]; then
|
||||
echo "ERROR: failed to download from $downloadUrl due to (error code was $status)"
|
||||
rm $SERVER
|
||||
downloadUrl=${PAPER_DOWNLOAD_URL:-https://ci.destroystokyo.com/job/PaperSpigot/$build/artifact/paperclip.jar}
|
||||
curl -fsSL -o $SERVER "$downloadUrl"
|
||||
if [ ! -f $SERVER ]; then
|
||||
echo "ERROR: failed to download from $downloadUrl (status=$?)"
|
||||
exit 3
|
||||
fi
|
||||
else
|
||||
@@ -115,45 +123,128 @@ function downloadPaper {
|
||||
|
||||
function installForge {
|
||||
TYPE=FORGE
|
||||
norm=$VANILLA_VERSION
|
||||
|
||||
echo "Checking Forge version information."
|
||||
case $FORGEVERSION in
|
||||
RECOMMENDED)
|
||||
wget -q -O /tmp/forge.json -sSL http://files.minecraftforge.net/maven/net/minecraftforge/forge/promotions_slim.json
|
||||
FORGE_VERSION=$(cat /tmp/forge.json | jq -r ".promos[\"$norm-recommended\"]")
|
||||
if [ $FORGE_VERSION = null ]; then
|
||||
FORGE_VERSION=$(cat /tmp/forge.json | jq -r ".promos[\"$norm-latest\"]")
|
||||
if [[ -z $FORGE_INSTALLER && -z $FORGE_INSTALLER_URL ]]; then
|
||||
norm=$VANILLA_VERSION
|
||||
|
||||
case $VANILLA_VERSION in
|
||||
*.*.*)
|
||||
norm=$VANILLA_VERSION ;;
|
||||
*.*)
|
||||
norm=${VANILLA_VERSION}.0 ;;
|
||||
esac
|
||||
|
||||
echo "Checking Forge version information."
|
||||
case $FORGEVERSION in
|
||||
RECOMMENDED)
|
||||
curl -fsSL -o /tmp/forge.json http://files.minecraftforge.net/maven/net/minecraftforge/forge/promotions_slim.json
|
||||
FORGE_VERSION=$(cat /tmp/forge.json | jq -r ".promos[\"$VANILLA_VERSION-recommended\"]")
|
||||
if [ $FORGE_VERSION = null ]; then
|
||||
echo "ERROR: Version $FORGE_VERSION is not supported by Forge"
|
||||
echo " Refer to http://files.minecraftforge.net/ for supported versions"
|
||||
FORGE_VERSION=$(cat /tmp/forge.json | jq -r ".promos[\"$VANILLA_VERSION-latest\"]")
|
||||
if [ $FORGE_VERSION = null ]; then
|
||||
echo "ERROR: Version $VANILLA_VERSION is not supported by Forge"
|
||||
echo " Refer to http://files.minecraftforge.net/ for supported versions"
|
||||
exit 2
|
||||
fi
|
||||
fi
|
||||
;;
|
||||
|
||||
*)
|
||||
FORGE_VERSION=$FORGEVERSION
|
||||
;;
|
||||
esac
|
||||
|
||||
normForgeVersion=$VANILLA_VERSION-$FORGE_VERSION-$norm
|
||||
shortForgeVersion=$VANILLA_VERSION-$FORGE_VERSION
|
||||
|
||||
FORGE_INSTALLER="/tmp/forge-$shortForgeVersion-installer.jar"
|
||||
elif [[ -z $FORGE_INSTALLER ]]; then
|
||||
FORGE_INSTALLER="/tmp/forge-installer.jar"
|
||||
elif [[ ! -e $FORGE_INSTALLER ]]; then
|
||||
echo "ERROR: the given Forge installer doesn't exist : $FORGE_INSTALLER"
|
||||
exit 2
|
||||
fi
|
||||
|
||||
installMarker=".forge-installed-$shortForgeVersion"
|
||||
|
||||
if [ ! -e $installMarker ]; then
|
||||
if [ ! -e $FORGE_INSTALLER ]; then
|
||||
|
||||
if [[ -z $FORGE_INSTALLER_URL ]]; then
|
||||
echo "Downloading $normForgeVersion"
|
||||
|
||||
forgeFileNames="
|
||||
$normForgeVersion/forge-$normForgeVersion-installer.jar
|
||||
$shortForgeVersion/forge-$shortForgeVersion-installer.jar
|
||||
END
|
||||
"
|
||||
for fn in $forgeFileNames; do
|
||||
if [ $fn == END ]; then
|
||||
echo "Unable to compute URL for $normForgeVersion"
|
||||
exit 2
|
||||
fi
|
||||
downloadUrl=http://files.minecraftforge.net/maven/net/minecraftforge/forge/$fn
|
||||
echo "...trying $downloadUrl"
|
||||
if curl -o $FORGE_INSTALLER -fsSL $downloadUrl; then
|
||||
break
|
||||
fi
|
||||
done
|
||||
else
|
||||
echo "Downloading $FORGE_INSTALLER_URL ..."
|
||||
if ! curl -o $FORGE_INSTALLER -fsSL $FORGE_INSTALLER_URL; then
|
||||
echo "Failed to download from given location $FORGE_INSTALLER_URL"
|
||||
exit 2
|
||||
fi
|
||||
fi
|
||||
;;
|
||||
fi
|
||||
|
||||
*)
|
||||
FORGE_VERSION=$FORGEVERSION
|
||||
;;
|
||||
esac
|
||||
echo "Installing Forge $shortForgeVersion using $FORGE_INSTALLER"
|
||||
mkdir -p mods
|
||||
tries=3
|
||||
while ((--tries >= 0)); do
|
||||
java -jar $FORGE_INSTALLER --installServer
|
||||
if [ $? == 0 ]; then
|
||||
break
|
||||
fi
|
||||
done
|
||||
if (($tries < 0)); then
|
||||
echo "Forge failed to install after several tries." >&2
|
||||
exit 10
|
||||
fi
|
||||
|
||||
# NOTE $shortForgeVersion will be empty if installer location was given to us
|
||||
echo "Finding installed server jar..."
|
||||
for j in *forge*.jar; do
|
||||
echo "...$j"
|
||||
case $j in
|
||||
*installer*)
|
||||
;;
|
||||
*)
|
||||
SERVER=$j
|
||||
break
|
||||
;;
|
||||
esac
|
||||
done
|
||||
if [[ -z $SERVER ]]; then
|
||||
echo "Unable to derive server jar for Forge"
|
||||
exit 2
|
||||
fi
|
||||
|
||||
echo "Using server $SERVER"
|
||||
echo $SERVER > $installMarker
|
||||
|
||||
# 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)
|
||||
if [[ $norm == '1.7.10' && $sorted == '10.13.2.1300' ]]; then
|
||||
# if $FORGEVERSION >= 10.13.2.1300
|
||||
normForgeVersion="$norm-$FORGE_VERSION-$norm"
|
||||
else
|
||||
normForgeVersion="$norm-$FORGE_VERSION"
|
||||
SERVER=$(cat $installMarker)
|
||||
fi
|
||||
}
|
||||
|
||||
FORGE_INSTALLER="forge-$normForgeVersion-installer.jar"
|
||||
SERVER="forge-$normForgeVersion-universal.jar"
|
||||
function isURL {
|
||||
local value=$1
|
||||
|
||||
if [ ! -e "$SERVER" ]; then
|
||||
echo "Downloading $FORGE_INSTALLER ..."
|
||||
wget -q http://files.minecraftforge.net/maven/net/minecraftforge/forge/$normForgeVersion/$FORGE_INSTALLER
|
||||
echo "Installing $SERVER"
|
||||
java -jar $FORGE_INSTALLER --installServer
|
||||
if [[ ${value:0:8} == "https://" || ${value:0:7} = "http://" ]]; then
|
||||
return 0
|
||||
else
|
||||
return 1
|
||||
fi
|
||||
}
|
||||
|
||||
@@ -168,6 +259,20 @@ function installFTB {
|
||||
exit 2
|
||||
fi
|
||||
local srv_modpack=${FTB_SERVER_MOD}
|
||||
if isURL ${srv_modpack}; then
|
||||
case $srv_modpack in
|
||||
*/download)
|
||||
break;;
|
||||
*)
|
||||
srv_modpack=${srv_modpack}/download;;
|
||||
esac
|
||||
local file=$(basename $(dirname $srv_modpack))
|
||||
local downloaded=/data/${file}.zip
|
||||
echo "Downloading FTB modpack...
|
||||
$srv_modpack -> $downloaded"
|
||||
curl -sSL -o $downloaded $srv_modpack
|
||||
srv_modpack=$downloaded
|
||||
fi
|
||||
if [[ ${srv_modpack:0:5} == "data/" ]]; then
|
||||
# Prepend with "/"
|
||||
srv_modpack=/${srv_modpack}
|
||||
@@ -187,12 +292,12 @@ function installFTB {
|
||||
fi
|
||||
|
||||
echo "Unpacking FTB server modpack ${srv_modpack} ..."
|
||||
local ftb_dir=/data/FeedTheBeast
|
||||
mkdir -p ${ftb_dir}
|
||||
unzip -u -o ${srv_modpack} -d ${ftb_dir}
|
||||
cp -f /data/eula.txt ${ftb_dir}/eula.txt
|
||||
FTB_SERVER_START=${ftb_dir}/ServerStart.sh
|
||||
mkdir -p ${FTB_DIR}
|
||||
unzip -o ${srv_modpack} -d ${FTB_DIR}
|
||||
cp -f /data/eula.txt ${FTB_DIR}/eula.txt
|
||||
FTB_SERVER_START=${FTB_DIR}/ServerStart.sh
|
||||
chmod a+x ${FTB_SERVER_START}
|
||||
sed -i "s/-jar/-Dfml.queryResult=confirm -jar/" ${FTB_SERVER_START}
|
||||
}
|
||||
|
||||
function installVanilla {
|
||||
@@ -297,12 +402,18 @@ if [[ "$MODPACK" ]]; then
|
||||
case "X$MODPACK" in
|
||||
X[Hh][Tt][Tt][Pp]*[Zz][iI][pP])
|
||||
echo "Downloading mod/plugin pack via HTTP"
|
||||
echo "$MODPACK"
|
||||
wget -q -O /tmp/modpack.zip "$MODPACK"
|
||||
echo " from $MODPACK ..."
|
||||
curl -sSL -o /tmp/modpack.zip "$MODPACK"
|
||||
if [ "$TYPE" = "SPIGOT" ]; then
|
||||
if [ "$REMOVE_OLD_MODS" = "TRUE" ]; then
|
||||
rm -rf /data/plugins/*
|
||||
fi
|
||||
mkdir -p /data/plugins
|
||||
unzip -o -d /data/plugins /tmp/modpack.zip
|
||||
else
|
||||
if [ "$REMOVE_OLD_MODS" = "TRUE" ]; then
|
||||
rm -rf /data/mods/*
|
||||
fi
|
||||
mkdir -p /data/mods
|
||||
unzip -o -d /data/mods /tmp/modpack.zip
|
||||
fi
|
||||
@@ -314,6 +425,28 @@ case "X$MODPACK" in
|
||||
esac
|
||||
fi
|
||||
|
||||
# If supplied with a URL for a config (simple zip of configurations), download it and unpack
|
||||
if [[ "$MODCONFIG" ]]; then
|
||||
case "X$MODCONFIG" in
|
||||
X[Hh][Tt][Tt][Pp]*[Zz][iI][pP])
|
||||
echo "Downloading mod/plugin configs via HTTP"
|
||||
echo " from $MODCONFIG ..."
|
||||
curl -sSL -o /tmp/modconfig.zip "$MODCONFIG"
|
||||
if [ "$TYPE" = "SPIGOT" ]; then
|
||||
mkdir -p /data/plugins
|
||||
unzip -o -d /data/plugins /tmp/modconfig.zip
|
||||
else
|
||||
mkdir -p /data/config
|
||||
unzip -o -d /data/config /tmp/modconfig.zip
|
||||
fi
|
||||
rm -f /tmp/modconfig.zip
|
||||
;;
|
||||
*)
|
||||
echo "Invalid URL given for modconfig: Must be HTTP or HTTPS and a ZIP file"
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
|
||||
function setServerProp {
|
||||
local prop=$1
|
||||
local var=$2
|
||||
@@ -338,11 +471,10 @@ if [ ! -e server.properties ]; then
|
||||
setServerProp "allow-nether" "$ALLOW_NETHER"
|
||||
setServerProp "announce-player-achievements" "$ANNOUNCE_PLAYER_ACHIEVEMENTS"
|
||||
setServerProp "enable-command-block" "$ENABLE_COMMAND_BLOCK"
|
||||
setServerProp "spawn-animals" "$SPAWN_ANIMAILS"
|
||||
setServerProp "spawn-animals" "$SPAWN_ANIMALS"
|
||||
setServerProp "spawn-monsters" "$SPAWN_MONSTERS"
|
||||
setServerProp "spawn-npcs" "$SPAWN_NPCS"
|
||||
setServerProp "generate-structures" "$GENERATE_STRUCTURES"
|
||||
setServerProp "spawn-npcs" "$SPAWN_NPCS"
|
||||
setServerProp "view-distance" "$VIEW_DISTANCE"
|
||||
setServerProp "hardcore" "$HARDCORE"
|
||||
setServerProp "max-build-height" "$MAX_BUILD_HEIGHT"
|
||||
@@ -367,7 +499,7 @@ if [ ! -e server.properties ]; then
|
||||
echo "Setting level type to $LEVEL_TYPE"
|
||||
# check for valid values and only then set
|
||||
case $LEVEL_TYPE in
|
||||
DEFAULT|FLAT|LARGEBIOMES|AMPLIFIED|CUSTOMIZED)
|
||||
DEFAULT|FLAT|LARGEBIOMES|AMPLIFIED|CUSTOMIZED|BIOMESOP)
|
||||
sed -i "/level-type\s*=/ c level-type=$LEVEL_TYPE" /data/server.properties
|
||||
;;
|
||||
*)
|
||||
@@ -424,7 +556,7 @@ if [ ! -e server.properties ]; then
|
||||
;;
|
||||
esac
|
||||
|
||||
sed -i "/gamemode\s*=/ c gamemode=$MODE" /data/server.properties
|
||||
sed -i "/^gamemode\s*=/ c gamemode=$MODE" $SERVER_PROPERTIES
|
||||
fi
|
||||
fi
|
||||
|
||||
@@ -452,21 +584,21 @@ if [ -n "$ICON" -a ! -e server-icon.png ]; then
|
||||
fi
|
||||
fi
|
||||
|
||||
# Make sure files exist to avoid errors
|
||||
if [ ! -e banned-players.json ]; then
|
||||
echo '' > banned-players.json
|
||||
fi
|
||||
if [ ! -e banned-ips.json ]; then
|
||||
echo '' > banned-ips.json
|
||||
fi
|
||||
# Make sure files exist and are valid JSON (for pre-1.12 to 1.12 upgrades)
|
||||
for j in *.json; do
|
||||
if [[ $(python -c "print open('$j').read().strip()==''") = True ]]; then
|
||||
echo "Fixing JSON $j"
|
||||
echo '[]' > $j
|
||||
fi
|
||||
done
|
||||
|
||||
# If any modules have been provided, copy them over
|
||||
[ -d /data/mods ] || mkdir /data/mods
|
||||
for m in /mods/*.jar
|
||||
mkdir -p /data/mods
|
||||
for m in /mods/*.{jar,zip}
|
||||
do
|
||||
if [ -f "$m" ]; then
|
||||
if [ -f "$m" -a ! -f "/data/mods/$m" ]; then
|
||||
echo Copying mod `basename "$m"`
|
||||
cp -f "$m" /data/mods
|
||||
cp "$m" /data/mods
|
||||
fi
|
||||
done
|
||||
[ -d /data/config ] || mkdir /data/config
|
||||
@@ -485,18 +617,25 @@ if [ "$TYPE" = "SPIGOT" ]; then
|
||||
fi
|
||||
fi
|
||||
|
||||
if [[ $CONSOLE = false ]]; then
|
||||
EXTRA_ARGS=--noconsole
|
||||
else
|
||||
EXTRA_ARGS=""
|
||||
EXTRA_ARGS=""
|
||||
# Optional disable console
|
||||
if [[ ${CONSOLE} = false || ${CONSOLE} = FALSE ]]; then
|
||||
EXTRA_ARGS+="--noconsole"
|
||||
fi
|
||||
|
||||
if [[ ! -z $MAX_MEMORY ]]; then
|
||||
# put prior JVM_OPTS at the end to give any memory settings there higher precedence
|
||||
JVM_OPTS="-Xms${MAX_MEMORY} -Xmx${MAX_MEMORY} ${JVM_OPTS}"
|
||||
# Optional disable GUI for headless servers
|
||||
if [[ ${GUI} = false || ${GUI} = FALSE ]]; then
|
||||
EXTRA_ARGS="${EXTRA_ARGS} nogui"
|
||||
fi
|
||||
set -x
|
||||
|
||||
# put these 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${INIT_MEMORY:-${MEMORY}} -Xmx${MAX_MEMORY:-${MEMORY}} ${JVM_OPTS}"
|
||||
|
||||
if [[ ${TYPE} == "FEED-THE-BEAST" ]]; then
|
||||
cp -f $SERVER_PROPERTIES ${FTB_DIR}/server.properties
|
||||
cp -f /data/{eula,ops,white-list}.txt ${FTB_DIR}/
|
||||
cd ${FTB_DIR}
|
||||
echo "Running FTB server modpack start ..."
|
||||
exec sh ${FTB_SERVER_START}
|
||||
else
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
#!/bin/sh
|
||||
|
||||
set -e
|
||||
sed -i "/^minecraft/s/1000/${UID}/g" /etc/passwd
|
||||
sed -i "/^minecraft/s/1000/${GID}/g" /etc/group
|
||||
sed -i "/^minecraft/s/:1000:1000:/:${UID}:${GID}:/g" /etc/passwd
|
||||
sed -i "/^minecraft/s/:1000:/:${GID}:/g" /etc/group
|
||||
|
||||
if [ "$SKIP_OWNERSHIP_FIX" != "TRUE" ]; then
|
||||
fix_ownership() {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
FROM itzg/gvm
|
||||
|
||||
MAINTAINER itzg
|
||||
LABEL maintainer "itzg"
|
||||
|
||||
RUN ["/run", "install", "springboot"]
|
||||
|
||||
|
||||
@@ -1,11 +1,12 @@
|
||||
FROM itzg/ubuntu-openjdk-7
|
||||
FROM openjdk:8-jre
|
||||
|
||||
MAINTAINER itzg
|
||||
LABEL maintainer "itzg"
|
||||
|
||||
ENV TITAN_VERSION 0.5.4
|
||||
|
||||
RUN wget -q -O /tmp/titan.zip http://s3.thinkaurelius.com/downloads/titan/titan-$TITAN_VERSION-hadoop2.zip
|
||||
RUN unzip -q /tmp/titan.zip -d /opt && rm /tmp/titan.zip
|
||||
ADD http://s3.thinkaurelius.com/downloads/titan/titan-$TITAN_VERSION-hadoop2.zip /tmp/titan.zip
|
||||
RUN unzip -q /tmp/titan.zip -d /opt && \
|
||||
rm /tmp/titan.zip
|
||||
|
||||
ENV TITAN_HOME /opt/titan-$TITAN_VERSION-hadoop2
|
||||
WORKDIR $TITAN_HOME
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
FROM itzg/ubuntu-openjdk-7
|
||||
|
||||
MAINTAINER itzg
|
||||
LABEL maintainer "itzg"
|
||||
|
||||
ENV APT_GET_UPDATE 2014-07-19
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
FROM ubuntu:trusty
|
||||
|
||||
MAINTAINER itzg
|
||||
LABEL maintainer "itzg"
|
||||
|
||||
ENV APT_GET_UPDATE 2015-10-29
|
||||
RUN apt-get update
|
||||
|
||||
Reference in New Issue
Block a user