mirror of
https://github.com/itzg/docker-minecraft-server.git
synced 2026-02-17 07:03:57 +00:00
Compare commits
116 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5ffc37ac80 | ||
|
|
807f4cb32b | ||
|
|
f23925f87f | ||
|
|
511912acc1 | ||
|
|
1531e38ab6 | ||
|
|
4f3789ef96 | ||
|
|
e751369d38 | ||
|
|
3ddbbf41d8 | ||
|
|
47c3cd096a | ||
|
|
df9909a8e4 | ||
|
|
73843ec783 | ||
|
|
ede30188b0 | ||
|
|
b679edbd62 | ||
|
|
fe846d8f28 | ||
|
|
0abb9edad8 | ||
|
|
9ff1b18935 | ||
|
|
67b41bb356 | ||
|
|
77b34f4c2c | ||
|
|
a698c4127c | ||
|
|
35e2448f8e | ||
|
|
da1a3a47cd | ||
|
|
98cec98dd9 | ||
|
|
342907dcba | ||
|
|
0e209eacee | ||
|
|
098888cfc6 | ||
|
|
1148aa3fe3 | ||
|
|
0ca336505d | ||
|
|
be17faf065 | ||
|
|
a73c63f482 | ||
|
|
45d3ef288f | ||
|
|
8b253fe50e | ||
|
|
1f58f59335 | ||
|
|
b48a13ed1d | ||
|
|
5a8f2a7395 | ||
|
|
34b96e0b63 | ||
|
|
6a12c33c33 | ||
|
|
b29e76b128 | ||
|
|
40a26b8caf | ||
|
|
28467d44b6 | ||
|
|
da34a546b5 | ||
|
|
4d45618125 | ||
|
|
4d1a05ccb0 | ||
|
|
03cac08999 | ||
|
|
a316bd8f95 | ||
|
|
73046d7499 | ||
|
|
67cf80d70f | ||
|
|
b51b19b3c0 | ||
|
|
1cc902062a | ||
|
|
36f5857de3 | ||
|
|
aef8f54903 | ||
|
|
fe3df584ef | ||
|
|
a73d99c552 | ||
|
|
72328ca8bc | ||
|
|
f3d5e75c22 | ||
|
|
fff075cc68 | ||
|
|
cca23aa683 | ||
|
|
ae72f9ac70 | ||
|
|
2b2ec51206 | ||
|
|
6135feec56 | ||
|
|
b38c00881b | ||
|
|
301e33f224 | ||
|
|
22417858a3 | ||
|
|
5d55ce2b25 | ||
|
|
a994e67ebf | ||
|
|
57a840b069 | ||
|
|
a273ef1763 | ||
|
|
a63f474109 | ||
|
|
d368978949 | ||
|
|
90d721763d | ||
|
|
6fc9ba4996 | ||
|
|
10e08e172a | ||
|
|
46270f6bd5 | ||
|
|
1c9274ad96 | ||
|
|
542798f7a6 | ||
|
|
bcf95e5799 | ||
|
|
02332ee8cd | ||
|
|
da4911c668 | ||
|
|
829eeebb7e | ||
|
|
20885c6cf7 | ||
|
|
f6465b5dac | ||
|
|
bd084cc261 | ||
|
|
895b7d74f5 | ||
|
|
ddbd88c601 | ||
|
|
7e34cf5ac9 | ||
|
|
8c26947fbc | ||
|
|
091e79c550 | ||
|
|
a31e2a8506 | ||
|
|
52d4cae74d | ||
|
|
cc83007cea | ||
|
|
0d9c2d13f9 | ||
|
|
ccec190cb2 | ||
|
|
c3ac69a030 | ||
|
|
fd4e9d93e0 | ||
|
|
2e353c084a | ||
|
|
9b1272edac | ||
|
|
479be8016a | ||
|
|
3f3a2d8433 | ||
|
|
7be2020879 | ||
|
|
73974d1c40 | ||
|
|
a4a22f3bfc | ||
|
|
491abfc833 | ||
|
|
7dc699ffbb | ||
|
|
3fee3f0f41 | ||
|
|
cf8b6e5d05 | ||
|
|
3bac706b8a | ||
|
|
6e3761ae91 | ||
|
|
b88ae49c3b | ||
|
|
79756d13fd | ||
|
|
44d2081b7b | ||
|
|
e8be7685e9 | ||
|
|
2d6316e6c3 | ||
|
|
009309966b | ||
|
|
d3e64ed56f | ||
|
|
715d9be403 | ||
|
|
ebe0a30c14 | ||
|
|
c8eb0f5874 |
@@ -8,3 +8,8 @@ This repository contains the various Dockerfile definitions I'm maintaining.
|
||||
##### Cassandra
|
||||
|
||||
I have found the [official image](https://hub.docker.com/_/cassandra/) to be quite sufficient
|
||||
|
||||
##### ELK Stack (Elasticsearch, Logstash, Kibana)
|
||||
|
||||
Each of the ELK components is now well supported by Elastic and the images here fell way
|
||||
behind the latest upstream releases.
|
||||
2
build
Executable file → Normal file
2
build
Executable file → Normal file
@@ -2,8 +2,6 @@
|
||||
|
||||
pkgs=ubuntu-openjdk-7
|
||||
pkgs="$pkgs minecraft-server"
|
||||
pkgs="$pkgs elasticsearch"
|
||||
pkgs="$pkgs kibana"
|
||||
pkgs="$pkgs titan-gremlin"
|
||||
|
||||
for p in $pkgs
|
||||
|
||||
@@ -1,30 +0,0 @@
|
||||
FROM itzg/ubuntu-openjdk-7
|
||||
|
||||
RUN apt-get update
|
||||
RUN DEBIAN_FRONTEND=noninteractive \
|
||||
apt-get install -yq git curl wget unzip openjdk-7-jdk && \
|
||||
apt-get clean
|
||||
|
||||
ENV MAVEN_VER 3.3.3
|
||||
ENV NODEJS_VER 0.12.7
|
||||
|
||||
RUN wget -O /tmp/maven.tgz http://apache.mirrors.pair.com/maven/maven-3/$MAVEN_VER/binaries/apache-maven-$MAVEN_VER-bin.tar.gz
|
||||
RUN tar xvf /tmp/maven.tgz && rm /tmp/maven.tgz
|
||||
ENV M2_HOME /opt/apache-maven-$MAVEN_VER
|
||||
ENV PATH $PATH:$M2_HOME/bin
|
||||
|
||||
RUN curl -s https://raw.githubusercontent.com/isaacs/nave/master/nave.sh > /usr/local/bin/nave
|
||||
RUN chmod +x /usr/local/bin/nave
|
||||
RUN nave usemain latest
|
||||
|
||||
RUN apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
|
||||
|
||||
VOLUME ["/shared"]
|
||||
|
||||
RUN useradd -m -d /home/developer developer
|
||||
|
||||
USER developer
|
||||
RUN curl -s get.gvmtool.net | bash
|
||||
|
||||
WORKDIR /home/developer
|
||||
CMD bash
|
||||
@@ -1,25 +0,0 @@
|
||||
Provides a development/build environment for Java, Groovy, and NodeJS.
|
||||
|
||||
* Provides 'gvm' for Groovy (and more) installation management
|
||||
* Provides 'nave' for NodeJS installation management
|
||||
* Pre-installs the latest NodeJS via nave
|
||||
|
||||
## Using the persistent/shared workarea
|
||||
|
||||
Since devbox containers are intended to be disposable, the image is configured
|
||||
with a "volume" at `/shared`.
|
||||
|
||||
There are a couple of ways you can leverage that volume. Either attach it to
|
||||
a host-local directory:
|
||||
|
||||
docker run -it -v $(pwd)/workarea:/shared --rm itzg/devbox
|
||||
|
||||
or run a "base" container and mounts the `/shared` from that onto any
|
||||
subsequent containers:
|
||||
|
||||
docker run --name devbox-base itzg/devbox touch /shared/READY
|
||||
...later...
|
||||
docker run -it --volumes-from devbox-base --rm itzg/devbox
|
||||
|
||||
**NOTE** I am using the `--rm` option so the devbox containers will be truly
|
||||
"burn after use".
|
||||
@@ -1,5 +0,0 @@
|
||||
**This image is now deprecated. **
|
||||
|
||||
Please use [itzg/elasticsearch](https://registry.hub.docker.com/u/itzg/elasticsearch/)
|
||||
instead. See the plugins configuration section for that image to see how
|
||||
to install Marvel.
|
||||
@@ -1,39 +0,0 @@
|
||||
FROM openjdk:8u121-jre-alpine
|
||||
|
||||
LABEL maintainer "itzg"
|
||||
|
||||
RUN apk -U add bash
|
||||
|
||||
ARG ES_VERSION=5.5.2
|
||||
# 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
|
||||
# need to adapt to both Docker's new remote-unpack-ADD behavior and the old behavior
|
||||
RUN cd /usr/share && \
|
||||
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
|
||||
|
||||
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 -u $DEFAULT_ES_USER_UID $DEFAULT_ES_USER
|
||||
|
||||
VOLUME ["/data","/conf"]
|
||||
|
||||
WORKDIR $ES_HOME
|
||||
|
||||
COPY java.policy /usr/lib/jvm/java-1.8-openjdk/jre/lib/security/
|
||||
COPY start /start
|
||||
COPY log4j2.properties $ES_HOME/config/
|
||||
|
||||
CMD ["/start"]
|
||||
@@ -1,258 +0,0 @@
|
||||
This Docker image provides an easily configurable Elasticsearch node. Via port mappings, it is easy to create an arbitrarily sized cluster of nodes. As long as the versions match, you can mix-and-match "real" Elasticsearch nodes with container-ized ones.
|
||||
|
||||
# NOTE for use on Linux hosts
|
||||
|
||||
Elasticsearch 5.x requires that the virtual memory mmap count is set sufficiently for stable,
|
||||
production use. [Refer to this guide for more information](https://www.elastic.co/guide/en/elasticsearch/reference/current/vm-max-map-count.html).
|
||||
|
||||
# Basic Usage
|
||||
|
||||
To start an Elasticsearch data node that listens on the standard ports on your host's network interface:
|
||||
|
||||
docker run -d -p 9200:9200 -p 9300:9300 itzg/elasticsearch
|
||||
|
||||
You'll then be able to connect to the Elasticsearch HTTP interface to confirm it's alive:
|
||||
|
||||
http://DOCKERHOST:9200/
|
||||
|
||||
{
|
||||
"status" : 200,
|
||||
"name" : "Charon",
|
||||
"version" : {
|
||||
"number" : "1.3.5",
|
||||
"build_hash" : "4a50e7df768fddd572f48830ae9c35e4ded86ac1",
|
||||
"build_timestamp" : "2014-11-05T15:21:28Z",
|
||||
"build_snapshot" : false,
|
||||
"lucene_version" : "4.9"
|
||||
},
|
||||
"tagline" : "You Know, for Search"
|
||||
}
|
||||
|
||||
Where `DOCKERHOST` would be the actual hostname of your host running Docker.
|
||||
|
||||
# Simple, multi-node cluster
|
||||
|
||||
To run a multi-node cluster (3-node in this example) on a single Docker machine use:
|
||||
|
||||
docker run -d --name es0 -p 9200:9200 itzg/elasticsearch
|
||||
docker run -d --name es1 --link es0 -e UNICAST_HOSTS=es0 itzg/elasticsearch
|
||||
docker run -d --name es2 --link es0 -e UNICAST_HOSTS=es0 itzg/elasticsearch
|
||||
|
||||
|
||||
and then check the cluster health, such as http://192.168.99.100:9200/_cluster/health?pretty
|
||||
|
||||
{
|
||||
"cluster_name" : "elasticsearch",
|
||||
"status" : "green",
|
||||
"timed_out" : false,
|
||||
"number_of_nodes" : 3,
|
||||
"number_of_data_nodes" : 3,
|
||||
"active_primary_shards" : 0,
|
||||
"active_shards" : 0,
|
||||
"relocating_shards" : 0,
|
||||
"initializing_shards" : 0,
|
||||
"unassigned_shards" : 0
|
||||
}
|
||||
|
||||
If you have a Docker Swarm cluster already initialized you can download this
|
||||
[docker-compose.yml](https://raw.githubusercontent.com/itzg/dockerfiles/master/elasticsearch/docker-compose.yml) and deploy a cluster using:
|
||||
|
||||
docker stack deploy -c docker-compose.yml es
|
||||
|
||||
|
||||
With a `docker service ls` you can confirm 1 master, 2 data, and 1 gateway nodes are running:
|
||||
|
||||
```
|
||||
ID NAME MODE REPLICAS IMAGE
|
||||
9nwnno8hbqgk es_kibana replicated 1/1 kibana:latest
|
||||
f5x7nipwmvkr es_gateway replicated 1/1 es
|
||||
om8rly2yxylw es_data replicated 2/2 es
|
||||
tdvfilj370yn es_master replicated 1/1 es
|
||||
```
|
||||
|
||||
As you can see, there is also a Kibana instance included and available at port 5601.
|
||||
|
||||
# Health Checks
|
||||
|
||||
This container declares a [HEALTHCHECK](https://docs.docker.com/engine/reference/builder/#/healthcheck) that queries the `_cat/health`
|
||||
endpoint for a quick, one-line gauge of health every 30 seconds.
|
||||
|
||||
The current health of the container is shown in the `STATUS` column of `docker ps`, such as
|
||||
|
||||
Up 14 minutes (healthy)
|
||||
|
||||
You can also check the history of health checks from `inspect`, such as:
|
||||
|
||||
```
|
||||
> docker inspect -f "{{json .State.Health}}" es
|
||||
{"Status":"healthy","FailingStreak":0,"Log":[...
|
||||
```
|
||||
|
||||
# Configuration Summary
|
||||
|
||||
## Ports
|
||||
|
||||
* `9200` - HTTP REST
|
||||
* `9300` - Native transport
|
||||
|
||||
## Volumes
|
||||
|
||||
* `/data` - location of `path.data`
|
||||
* `/conf` - location of `path.conf`
|
||||
|
||||
# Configuration Details
|
||||
|
||||
The following configuration options are specified using `docker run` environment variables (`-e`) like
|
||||
|
||||
docker run ... -e NAME=VALUE ... itzg/elasticsearch
|
||||
|
||||
Since Docker's `-e` settings are baked into the container definition, this image provides an extra feature to change any of the settings below for an existing container. Either create/edit the file `env` in the `/conf` volume mapping or edit within the running container's context using:
|
||||
|
||||
docker exec -it CONTAINER_ID vi /conf/env
|
||||
|
||||
replacing `CONTAINER_ID` with the container's ID or name.
|
||||
|
||||
The contents of the `/conf/env` file are standard shell
|
||||
|
||||
NAME=VALUE
|
||||
|
||||
entries where `NAME` is one of the variables described below.
|
||||
|
||||
Configuration options not explicitly supported below can be specified via the `OPTS` environment variable. For example, by default `OPTS` is set with
|
||||
|
||||
OPTS=-Dnetwork.bind_host=_non_loopback_
|
||||
|
||||
_NOTE: That option is a default since `bind_host` defaults to `localhost` as of 2.0, which isn't helpful for
|
||||
port mapping out from the container_.
|
||||
|
||||
## Cluster Name
|
||||
|
||||
If joining a pre-existing cluster, then you may need to specify a cluster name different than the default "elasticsearch":
|
||||
|
||||
-e CLUSTER=dockers
|
||||
|
||||
## Zen Unicast Hosts
|
||||
|
||||
When joining a multi-physical-host cluster, multicast may not be supported on the physical network. In that case, your node can reference specific one or more hosts in the cluster via the [Zen Unicast Hosts](http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/modules-discovery-zen.html#unicast) capability as a comma-separated list of `HOST:PORT` pairs:
|
||||
|
||||
-e UNICAST_HOSTS=HOST:PORT[,HOST:PORT]
|
||||
|
||||
such as
|
||||
|
||||
-e UNICAST_HOSTS=192.168.0.100:9300
|
||||
|
||||
## Plugins
|
||||
|
||||
You can install one or more plugins before startup by passing a comma-separated list of plugins.
|
||||
|
||||
-e PLUGINS=ID[,ID]
|
||||
|
||||
In this example, it will install the Marvel plugin
|
||||
|
||||
-e PLUGINS=elasticsearch/marvel/latest
|
||||
|
||||
Many more plugins [are available here](http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/modules-plugins.html#known-plugins).
|
||||
|
||||
## Publish As
|
||||
|
||||
Since the container gives the Elasticsearch software an isolated perspective of its networking, it will most likely advertise its published address with a container-internal IP address. This can be overridden with a physical networking name and port using:
|
||||
|
||||
-e PUBLISH_AS=DOCKERHOST:9301
|
||||
|
||||
_Author Note: I have yet to hit a case where this was actually necessary. Other
|
||||
than the cosmetic weirdness in the logs, Elasticsearch seems to be quite tolerant._
|
||||
|
||||
## Node Name
|
||||
|
||||
Rather than use the randomly assigned node name, you can indicate a specific one using:
|
||||
|
||||
-e NODE_NAME=Docker
|
||||
|
||||
## Node Type
|
||||
|
||||
If you refer to [the Node section](https://www.elastic.co/guide/en/elasticsearch/reference/2.3/modules-node.html)
|
||||
of the Elasticsearch reference guide, you'll find that there's three main types of nodes: master-eligible, data, and client.
|
||||
|
||||
In larger clusters it is important to dedicate a small number (>= 3) of master nodes. There are also cases where a large cluster may need dedicated gateway nodes that are neither master nor data nodes and purely operate as "smart routers" and have large amounts of CPU and memory to handle client requests and search-reduce.
|
||||
|
||||
To simplify all that, this image provides a `TYPE` variable to let you amongst these combinations. The choices are:
|
||||
|
||||
* (not set, the default) : the default node type which is both master-eligible and a data node
|
||||
* `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.
|
||||
* `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: '3'
|
||||
|
||||
services:
|
||||
gateway:
|
||||
image: itzg/elasticsearch
|
||||
environment:
|
||||
UNICAST_HOSTS: master
|
||||
TYPE: GATEWAY
|
||||
ports:
|
||||
- "9200:9200"
|
||||
|
||||
master:
|
||||
image: itzg/elasticsearch
|
||||
environment:
|
||||
UNICAST_HOSTS: gateway
|
||||
TYPE: MASTER
|
||||
MIN_MASTERS: 2
|
||||
|
||||
data:
|
||||
image: itzg/elasticsearch
|
||||
environment:
|
||||
UNICAST_HOSTS: master,gateway
|
||||
TYPE: DATA
|
||||
|
||||
kibana:
|
||||
image: kibana
|
||||
ports:
|
||||
- "5601:5601"
|
||||
environment:
|
||||
ELASTICSEARCH_URL: http://gateway:9200
|
||||
|
||||
```
|
||||
|
||||
## Minimum Master Nodes
|
||||
|
||||
In combination with the `TYPE` variable above, you will also want to configure the minimum master nodes to [avoid split-brain](https://www.elastic.co/guide/en/elasticsearch/reference/2.3/modules-node.html#split-brain) during network outages.
|
||||
|
||||
The minimum, which can be calculated as `(master_eligible_nodes / 2) + 1`, can be set with the `MIN_MASTERS` variable.
|
||||
|
||||
Using the Docker Compose file above, a value of `2` is appropriate when scaling the cluster to 3 master nodes:
|
||||
|
||||
docker-compose scale master=3
|
||||
|
||||
## Multiple Network Binding, such as Swarm Mode
|
||||
|
||||
When using Docker Swarm mode the container is presented with multiple ethernet
|
||||
devices. By default, all global, routable IP addresses are configured for
|
||||
Elasticsearch to use as `network.host`.
|
||||
|
||||
That discovery can be overridden by providing a specific ethernet device name
|
||||
to `DISCOVER_TRANSPORT_IP` and/or `DISCOVER_HTTP_IP`, such as
|
||||
|
||||
-e DISCOVER_TRANSPORT_IP=eth0
|
||||
-e DISCOVER_HTTP_IP=eth2
|
||||
|
||||
## Heap size and other JVM options
|
||||
|
||||
By default this image will run Elasticsearch with a Java heap size of 1 GB. If that value
|
||||
or any other JVM options need to be adjusted, then replace the `ES_JAVA_OPTS`
|
||||
environment variable.
|
||||
|
||||
For example, this would allow for the use of 16 GB of heap:
|
||||
|
||||
-e ES_JAVA_OPTS="-Xms16g -Xmx16g"
|
||||
|
||||
Refer to [this page](https://www.elastic.co/guide/en/elasticsearch/reference/current/heap-size.html)
|
||||
for more information about why both the minimum and maximum sizes were set to
|
||||
the same value.
|
||||
@@ -1,35 +0,0 @@
|
||||
# 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
|
||||
@@ -1,35 +0,0 @@
|
||||
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
|
||||
@@ -1,21 +0,0 @@
|
||||
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
|
||||
@@ -1,44 +0,0 @@
|
||||
version: '3'
|
||||
|
||||
services:
|
||||
master:
|
||||
image: itzg/elasticsearch
|
||||
environment:
|
||||
TYPE: MASTER
|
||||
UNICAST_HOSTS: master
|
||||
MIN_MASTERS: 1
|
||||
deploy:
|
||||
replicas: 1
|
||||
update_config:
|
||||
parallelism: 1
|
||||
data:
|
||||
image: itzg/elasticsearch
|
||||
environment:
|
||||
TYPE: DATA
|
||||
UNICAST_HOSTS: master
|
||||
deploy:
|
||||
replicas: 2
|
||||
update_config:
|
||||
parallelism: 1
|
||||
delay: 60s
|
||||
gateway:
|
||||
image: itzg/elasticsearch
|
||||
ports:
|
||||
- "9200:9200"
|
||||
- "9300:9300"
|
||||
environment:
|
||||
TYPE: GATEWAY
|
||||
UNICAST_HOSTS: master
|
||||
ingest:
|
||||
image: itzg/elasticsearch
|
||||
ports:
|
||||
- "9222:9200"
|
||||
environment:
|
||||
TYPE: INGEST
|
||||
UNICAST_HOSTS: master
|
||||
kibana:
|
||||
image: kibana
|
||||
ports:
|
||||
- "5601:5601"
|
||||
environment:
|
||||
ELASTICSEARCH_URL: http://gateway:9200
|
||||
@@ -1,6 +0,0 @@
|
||||
grant {
|
||||
// JMX Java Management eXtensions
|
||||
permission javax.management.MBeanTrustPermission "register";
|
||||
permission javax.management.MBeanServerPermission "createMBeanServer";
|
||||
permission javax.management.MBeanPermission "-#-[-]", "queryNames";
|
||||
};
|
||||
@@ -1,74 +0,0 @@
|
||||
status = error
|
||||
|
||||
# log action execution errors for easier debugging
|
||||
logger.action.name = org.elasticsearch.action
|
||||
logger.action.level = debug
|
||||
|
||||
appender.console.type = Console
|
||||
appender.console.name = console
|
||||
appender.console.layout.type = PatternLayout
|
||||
appender.console.layout.pattern = [%d{ISO8601}][%-5p][%-25c{1.}] %marker%m%n
|
||||
|
||||
appender.rolling.type = RollingFile
|
||||
appender.rolling.name = rolling
|
||||
appender.rolling.fileName = ${sys:es.logs}.log
|
||||
appender.rolling.layout.type = PatternLayout
|
||||
appender.rolling.layout.pattern = [%d{ISO8601}][%-5p][%-25c{1.}] %marker%.10000m%n
|
||||
appender.rolling.filePattern = ${sys:es.logs}-%d{yyyy-MM-dd}.log
|
||||
appender.rolling.policies.type = Policies
|
||||
appender.rolling.policies.time.type = TimeBasedTriggeringPolicy
|
||||
appender.rolling.policies.time.interval = 1
|
||||
appender.rolling.policies.time.modulate = true
|
||||
|
||||
rootLogger.level = info
|
||||
rootLogger.appenderRef.console.ref = console
|
||||
#rootLogger.appenderRef.rolling.ref = rolling
|
||||
|
||||
appender.deprecation_rolling.type = RollingFile
|
||||
appender.deprecation_rolling.name = deprecation_rolling
|
||||
appender.deprecation_rolling.fileName = ${sys:es.logs}_deprecation.log
|
||||
appender.deprecation_rolling.layout.type = PatternLayout
|
||||
appender.deprecation_rolling.layout.pattern = [%d{ISO8601}][%-5p][%-25c{1.}] %marker%.10000m%n
|
||||
appender.deprecation_rolling.filePattern = ${sys:es.logs}_deprecation-%i.log.gz
|
||||
appender.deprecation_rolling.policies.type = Policies
|
||||
appender.deprecation_rolling.policies.size.type = SizeBasedTriggeringPolicy
|
||||
appender.deprecation_rolling.policies.size.size = 1GB
|
||||
appender.deprecation_rolling.strategy.type = DefaultRolloverStrategy
|
||||
appender.deprecation_rolling.strategy.max = 4
|
||||
|
||||
logger.deprecation.name = org.elasticsearch.deprecation
|
||||
logger.deprecation.level = warn
|
||||
#logger.deprecation.appenderRef.deprecation_rolling.ref = deprecation_rolling
|
||||
logger.deprecation.additivity = false
|
||||
|
||||
appender.index_search_slowlog_rolling.type = RollingFile
|
||||
appender.index_search_slowlog_rolling.name = index_search_slowlog_rolling
|
||||
appender.index_search_slowlog_rolling.fileName = ${sys:es.logs}_index_search_slowlog.log
|
||||
appender.index_search_slowlog_rolling.layout.type = PatternLayout
|
||||
appender.index_search_slowlog_rolling.layout.pattern = [%d{ISO8601}][%-5p][%-25c] %marker%.10000m%n
|
||||
appender.index_search_slowlog_rolling.filePattern = ${sys:es.logs}_index_search_slowlog-%d{yyyy-MM-dd}.log
|
||||
appender.index_search_slowlog_rolling.policies.type = Policies
|
||||
appender.index_search_slowlog_rolling.policies.time.type = TimeBasedTriggeringPolicy
|
||||
appender.index_search_slowlog_rolling.policies.time.interval = 1
|
||||
appender.index_search_slowlog_rolling.policies.time.modulate = true
|
||||
|
||||
logger.index_search_slowlog_rolling.name = index.search.slowlog
|
||||
logger.index_search_slowlog_rolling.level = trace
|
||||
logger.index_search_slowlog_rolling.appenderRef.index_search_slowlog_rolling.ref = console
|
||||
logger.index_search_slowlog_rolling.additivity = false
|
||||
|
||||
appender.index_indexing_slowlog_rolling.type = RollingFile
|
||||
appender.index_indexing_slowlog_rolling.name = index_indexing_slowlog_rolling
|
||||
appender.index_indexing_slowlog_rolling.fileName = ${sys:es.logs}_index_indexing_slowlog.log
|
||||
appender.index_indexing_slowlog_rolling.layout.type = PatternLayout
|
||||
appender.index_indexing_slowlog_rolling.layout.pattern = [%d{ISO8601}][%-5p][%-25c] %marker%.10000m%n
|
||||
appender.index_indexing_slowlog_rolling.filePattern = ${sys:es.logs}_index_indexing_slowlog-%d{yyyy-MM-dd}.log
|
||||
appender.index_indexing_slowlog_rolling.policies.type = Policies
|
||||
appender.index_indexing_slowlog_rolling.policies.time.type = TimeBasedTriggeringPolicy
|
||||
appender.index_indexing_slowlog_rolling.policies.time.interval = 1
|
||||
appender.index_indexing_slowlog_rolling.policies.time.modulate = true
|
||||
|
||||
logger.index_indexing_slowlog.name = index.indexing.slowlog.index
|
||||
logger.index_indexing_slowlog.level = trace
|
||||
logger.index_indexing_slowlog.appenderRef.index_indexing_slowlog_rolling.ref = console
|
||||
logger.index_indexing_slowlog.additivity = false
|
||||
@@ -1,165 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
pre_checks() {
|
||||
mmc=$(sysctl vm.max_map_count|sed 's/.*= //')
|
||||
if [[ $mmc -lt 262144 ]]; then
|
||||
echo "
|
||||
ERROR: As of 5.0.0 Elasticsearch requires increasing mmap counts.
|
||||
Refer to https://www.elastic.co/guide/en/elasticsearch/reference/current/vm-max-map-count.html
|
||||
"
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
|
||||
discoverIpFromLink() {
|
||||
dev=$1
|
||||
mode=$2
|
||||
ip=`ipaddr show dev $dev scope global|awk '$1 == "inet" { if (!match($2,"/32")) { gsub("/.*","",$2) ; print $2 } }'`
|
||||
echo "Discovered $mode address $ip for $dev"
|
||||
OPTS="$OPTS -E $mode.host=$ip"
|
||||
}
|
||||
|
||||
discoverAllGlobalIps() {
|
||||
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"
|
||||
}
|
||||
|
||||
setup_clustering() {
|
||||
|
||||
if [ -n "$CLUSTER" ]; then
|
||||
OPTS="$OPTS -E cluster.name=$CLUSTER"
|
||||
if [ -n "$CLUSTER_FROM" ]; then
|
||||
if [ -d /data/$CLUSTER_FROM -a ! -d /data/$CLUSTER ]; then
|
||||
echo "Performing cluster data migration from $CLUSTER_FROM to $CLUSTER"
|
||||
mv /data/$CLUSTER_FROM /data/$CLUSTER
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ -n "$NODE_NAME" ]; then
|
||||
OPTS="$OPTS -E node.name=$NODE_NAME"
|
||||
fi
|
||||
|
||||
if [ -n "$MULTICAST" ]; then
|
||||
OPTS="$OPTS -E discovery.zen.ping.multicast.enabled=$MULTICAST"
|
||||
fi
|
||||
|
||||
if [ -n "$UNICAST_HOSTS" ]; then
|
||||
OPTS="$OPTS -E discovery.zen.ping.unicast.hosts=$UNICAST_HOSTS"
|
||||
fi
|
||||
|
||||
if [ -n "$PUBLISH_AS" ]; then
|
||||
OPTS="$OPTS -E transport.publish_host=$(echo $PUBLISH_AS | awk -F: '{print $1}')"
|
||||
OPTS="$OPTS -E transport.publish_port=$(echo $PUBLISH_AS | awk -F: '{if ($2) print $2; else print 9300}')"
|
||||
fi
|
||||
|
||||
if [ -n "$MIN_MASTERS" ]; then
|
||||
OPTS="$OPTS -E discovery.zen.minimum_master_nodes=$MIN_MASTERS"
|
||||
fi
|
||||
|
||||
}
|
||||
|
||||
install_plugins() {
|
||||
|
||||
if [ -n "$PLUGINS" ]; then
|
||||
for p in $(echo $PLUGINS | awk -v RS=, '{print}')
|
||||
do
|
||||
echo "Installing the plugin $p"
|
||||
$ES_HOME/bin/elasticsearch-plugin install $p
|
||||
done
|
||||
else
|
||||
mkdir -p $ES_HOME/plugins
|
||||
fi
|
||||
}
|
||||
|
||||
setup_personality() {
|
||||
|
||||
if [ -n "$TYPE" ]; then
|
||||
case $TYPE in
|
||||
MASTER)
|
||||
OPTS="$OPTS -E node.master=true -E node.data=false -E node.ingest=false"
|
||||
;;
|
||||
|
||||
GATEWAY|COORDINATING)
|
||||
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)
|
||||
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"
|
||||
;;
|
||||
|
||||
*)
|
||||
echo "Unknown node type. Please use MASTER|GATEWAY|DATA|NON_MASTER"
|
||||
exit 1
|
||||
esac
|
||||
fi
|
||||
|
||||
}
|
||||
|
||||
pre_checks
|
||||
|
||||
if [ -f /conf/env ]; then
|
||||
. /conf/env
|
||||
fi
|
||||
|
||||
if [ ! -e /conf/elasticsearch.* ]; then
|
||||
cp $ES_HOME/config/elasticsearch.yml /conf
|
||||
fi
|
||||
|
||||
if [ ! -e /conf/log4j2.properties ]; then
|
||||
cp $ES_HOME/config/log4j2.properties /conf
|
||||
fi
|
||||
|
||||
OPTS="$OPTS \
|
||||
-E path.conf=/conf \
|
||||
-E path.data=/data \
|
||||
-E path.logs=/data \
|
||||
-E transport.tcp.port=9300 \
|
||||
-E http.port=9200"
|
||||
|
||||
discoverAllGlobalIps
|
||||
if [ "${DISCOVER_TRANSPORT_IP}" != "" ]; then
|
||||
discoverIpFromLink $DISCOVER_TRANSPORT_IP transport
|
||||
fi
|
||||
if [ "${DISCOVER_HTTP_IP}" != "" ]; then
|
||||
discoverIpFromLink $DISCOVER_HTTP_IP http
|
||||
fi
|
||||
|
||||
setup_personality
|
||||
setup_clustering
|
||||
install_plugins
|
||||
|
||||
mkdir -p /conf/scripts
|
||||
|
||||
echo "Starting Elasticsearch with the options $OPTS"
|
||||
CMD="$ES_HOME/bin/elasticsearch $OPTS"
|
||||
if [ `id -u` = 0 ]; then
|
||||
echo "Running as non-root..."
|
||||
chown -R $DEFAULT_ES_USER /data /conf
|
||||
su -c "$CMD" $DEFAULT_ES_USER
|
||||
else
|
||||
$CMD
|
||||
fi
|
||||
0
gitblit/start.sh
Executable file → Normal file
0
gitblit/start.sh
Executable file → Normal file
@@ -1,12 +0,0 @@
|
||||
FROM itzg/ubuntu-openjdk-7
|
||||
|
||||
LABEL maintainer "itzg"
|
||||
|
||||
RUN apt-get install -y curl unzip
|
||||
|
||||
RUN curl -s get.gvmtool.net | bash
|
||||
|
||||
ADD run /run
|
||||
ONBUILD RUN ["/run", "selfupdate"]
|
||||
|
||||
ENTRYPOINT ["/run"]
|
||||
0
jekyll-github-pages/start.sh
Executable file → Normal file
0
jekyll-github-pages/start.sh
Executable file → Normal file
0
jenkins/download-and-start.sh
Executable file → Normal file
0
jenkins/download-and-start.sh
Executable file → Normal file
@@ -1,22 +0,0 @@
|
||||
FROM openjdk:8u111-jre
|
||||
|
||||
LABEL maintainer "itzg"
|
||||
|
||||
ENV KIBANA_VERSION 5.1.2
|
||||
|
||||
ADD https://artifacts.elastic.co/downloads/kibana/kibana-${KIBANA_VERSION}-linux-x86_64.tar.gz /tmp/kibana.tgz
|
||||
|
||||
RUN tar -C /opt -xzf /tmp/kibana.tgz && rm /tmp/kibana.tgz
|
||||
|
||||
ENV KIBANA_HOME /opt/kibana-$KIBANA_VERSION-linux-x86_64
|
||||
|
||||
# Simplify for cross-container
|
||||
ENV ES_URL http://es:9200
|
||||
|
||||
WORKDIR $KIBANA_HOME
|
||||
|
||||
ADD start.sh /start
|
||||
|
||||
EXPOSE 5601
|
||||
|
||||
CMD ["/start"]
|
||||
@@ -1,26 +0,0 @@
|
||||
|
||||
Provides a ready-to-run [Kibana](http://www.elasticsearch.org/overview/kibana/) server that can
|
||||
easily hook into your [Elasticsearch containers](https://registry.hub.docker.com/u/itzg/elasticsearch/).
|
||||
|
||||
## Usage with Docker elasticsearch container
|
||||
|
||||
This is by far the easiest and most Docker'ish way to run Kibana.
|
||||
|
||||
Assuming you started one or more containers using something like
|
||||
|
||||
docker run -d --name your-es -p 9200:9200 itzg/elasticsearch
|
||||
|
||||
Start Kibana using
|
||||
|
||||
docker run -d -p 5601:5601 --link your-es:es itzg/kibana
|
||||
|
||||
Proceed to use Kibana starting from
|
||||
[this point in the documentation](http://www.elasticsearch.org/guide/en/kibana/current/access.html)
|
||||
|
||||
## Usage with non-Docker elasticsearch
|
||||
|
||||
Start Kibana using
|
||||
|
||||
docker run -d -p 5601:5601 -e ES_URL=http://YOUR_ES:9200 itzg/kibana
|
||||
|
||||
Replacing `http://YOUR_ES:9200` with the appropriate URL for your system.
|
||||
@@ -1,12 +0,0 @@
|
||||
version: '2'
|
||||
|
||||
services:
|
||||
es:
|
||||
build: ../elasticsearch
|
||||
ports:
|
||||
- "9200:9200"
|
||||
|
||||
kibana:
|
||||
build: .
|
||||
ports:
|
||||
- "5601:5601"
|
||||
@@ -1,5 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
OPTS="-e $ES_URL -H $HOSTNAME"
|
||||
|
||||
exec bin/kibana $OPTS
|
||||
@@ -1,25 +0,0 @@
|
||||
FROM itzg/ubuntu-openjdk-7
|
||||
|
||||
LABEL maintainer "itzg"
|
||||
|
||||
ENV LOGSTASH_VERSION 1.5.0-1
|
||||
|
||||
RUN wget -qO /tmp/logstash.deb http://download.elastic.co/logstash/logstash/packages/debian/logstash_${LOGSTASH_VERSION}_all.deb
|
||||
|
||||
RUN dpkg -i /tmp/logstash.deb && rm /tmp/logstash.deb
|
||||
|
||||
WORKDIR /opt/logstash
|
||||
|
||||
# For collectd reception
|
||||
EXPOSE 25826
|
||||
|
||||
# /conf is the default directory where our logstash will read pipeline config files
|
||||
# /logs is an optional attach point to reference something like /var/log on the host
|
||||
VOLUME ["/conf","/logs"]
|
||||
|
||||
ENV PLUGIN_UPDATES 2015-06-10
|
||||
|
||||
RUN bin/plugin install logstash-input-heartbeat
|
||||
RUN bin/plugin install logstash-output-elasticsearch_groom
|
||||
|
||||
CMD ["bin/logstash","agent","-f","/conf"]
|
||||
@@ -1,44 +0,0 @@
|
||||
This image bundles the latest (1.5.x) version of Logstash with the ability to
|
||||
groom its own Elasticsearch indices.
|
||||
|
||||
# Basic Usage
|
||||
|
||||
To start a Logstash container, setup a directory on your host with one or more Logstash
|
||||
pipeline configurations files, called `$HOST_CONF` here, and run
|
||||
|
||||
docker run -d -v $HOST_CONF:/conf itzg/logstash
|
||||
|
||||
# Accessing host logs
|
||||
|
||||
Logstash is much more useful when it is actually processing...logs. Logs inside the container
|
||||
are non-existent, but you can attach the host machine's `/var/log` directory via the container's
|
||||
`/logs` volume:
|
||||
|
||||
docker run ... -v /var/log:/logs ...
|
||||
|
||||
Keep in mind you will need to configure `file` inputs with a base path of `/logs`, such as
|
||||
|
||||
```
|
||||
file {
|
||||
path => ['/logs/syslog']
|
||||
type => 'syslog'
|
||||
}
|
||||
```
|
||||
|
||||
# Receiving input from collectd
|
||||
|
||||
To allow for incoming [collectd](https://collectd.org/) content, **UDP** port 25826 is exposed and
|
||||
can be mapped onto the host using:
|
||||
|
||||
docker run ... -p 25826:25826/udp
|
||||
|
||||
Regardless of the host port, be sure to configure the logstash input to bind at port `25826`, such
|
||||
as
|
||||
|
||||
```
|
||||
udp {
|
||||
port => 25826
|
||||
codec => collectd { }
|
||||
buffer_size => 1452
|
||||
}
|
||||
```
|
||||
@@ -1,25 +0,0 @@
|
||||
input {
|
||||
heartbeat {
|
||||
type => 'groom'
|
||||
interval => 11
|
||||
add_field => {
|
||||
scope => 'open'
|
||||
cutoff => '4w'
|
||||
action => 'close'
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
output {
|
||||
|
||||
if [type] == 'groom' {
|
||||
elasticsearch_groom {
|
||||
host => 'es:9200'
|
||||
index => 'logstash-%{+YYYY.MM.dd}'
|
||||
scope => '%{scope}'
|
||||
age_cutoff => '%{cutoff}'
|
||||
action => '%{action}'
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,21 +1,24 @@
|
||||
FROM openjdk:8u171-jre-alpine
|
||||
FROM openjdk:8u212-jre-alpine
|
||||
|
||||
LABEL maintainer "itzg"
|
||||
|
||||
RUN apk add --no-cache -U \
|
||||
openssl \
|
||||
imagemagick \
|
||||
lsof \
|
||||
su-exec \
|
||||
shadow \
|
||||
bash \
|
||||
curl iputils wget \
|
||||
git \
|
||||
jq \
|
||||
mysql-client \
|
||||
python python-dev py2-pip
|
||||
openssl \
|
||||
imagemagick \
|
||||
lsof \
|
||||
su-exec \
|
||||
shadow \
|
||||
bash \
|
||||
curl iputils wget \
|
||||
git \
|
||||
jq \
|
||||
mysql-client \
|
||||
tzdata \
|
||||
rsync \
|
||||
nano \
|
||||
python python-dev py2-pip
|
||||
|
||||
RUN pip install mcstatus
|
||||
RUN pip install mcstatus yq
|
||||
|
||||
HEALTHCHECK CMD mcstatus localhost:$SERVER_PORT ping
|
||||
|
||||
@@ -26,9 +29,12 @@ RUN addgroup -g 1000 minecraft \
|
||||
|
||||
EXPOSE 25565 25575
|
||||
|
||||
ARG RESTIFY_VER=1.1.4
|
||||
ARG RCON_CLI_VER=1.4.0
|
||||
ARG MC_SERVER_RUNNER_VER=1.2.0
|
||||
RUN echo 'hosts: files dns' > /etc/nsswitch.conf
|
||||
|
||||
ARG RESTIFY_VER=1.1.6
|
||||
ARG RCON_CLI_VER=1.4.6
|
||||
ARG MC_SERVER_RUNNER_VER=1.3.2
|
||||
ARG TOF_BUILDTOOLS_VER=1.2.0
|
||||
ARG ARCH=amd64
|
||||
|
||||
ADD https://github.com/itzg/restify/releases/download/${RESTIFY_VER}/restify_${RESTIFY_VER}_linux_${ARCH}.tar.gz /tmp/restify.tgz
|
||||
@@ -43,19 +49,37 @@ ADD https://github.com/itzg/mc-server-runner/releases/download/${MC_SERVER_RUNNE
|
||||
RUN tar -x -C /usr/local/bin -f /tmp/mc-server-runner.tgz mc-server-runner && \
|
||||
rm /tmp/mc-server-runner.tgz
|
||||
|
||||
ADD https://git.faldoria.de/tof/server/build-tools/-/jobs/artifacts/buildtools-${TOF_BUILDTOOLS_VER}/raw/target/ToF-BuildTools.jar?job=release-artifact /tmp/tof-buildtools/BuildTools.jar
|
||||
|
||||
ONBUILD ARG BUILDTOOLS_OUTPUT=/plugins
|
||||
ONBUILD COPY *Dockerfile* *plugins.yml /tmp/tof-buildtools/
|
||||
ONBUILD RUN \
|
||||
[ -d /tmp/tof-buildtools ] && \
|
||||
[ $(find /tmp/tof-buildtools -type f -name plugins.yml | wc -l) -gt 0 ] && \
|
||||
java -jar /tmp/tof-buildtools/BuildTools.jar \
|
||||
--config "/tmp/tof-buildtools/plugins.yml" \
|
||||
--configs "plugins.yml" \
|
||||
--dir "/tmp/tof-buildtools/" \
|
||||
--output ${BUILDTOOLS_OUTPUT} && \
|
||||
chown -R minecraft:minecraft ${BUILDTOOLS_OUTPUT} && \
|
||||
rm -fR /tmp/tof-buildtools/ || \
|
||||
true
|
||||
|
||||
COPY mcadmin.jq /usr/share
|
||||
RUN chmod +x /usr/local/bin/*
|
||||
|
||||
VOLUME ["/data","/mods","/config","/plugins"]
|
||||
VOLUME ["/data","/mods","/config"]
|
||||
COPY server.properties /tmp/server.properties
|
||||
WORKDIR /data
|
||||
|
||||
ENTRYPOINT [ "/start" ]
|
||||
|
||||
ENV UID=1000 GID=1000 \
|
||||
JVM_XX_OPTS="-XX:+UseG1GC" MEMORY="1G" \
|
||||
TYPE=VANILLA VERSION=LATEST FORGEVERSION=RECOMMENDED SPONGEBRANCH=STABLE SPONGEVERSION= LEVEL=world \
|
||||
PVP=true DIFFICULTY=easy ENABLE_RCON=true RCON_PORT=25575 RCON_PASSWORD=minecraft \
|
||||
LEVEL_TYPE=DEFAULT GENERATOR_SETTINGS= WORLD= MODPACK= SERVER_PORT=25565 ONLINE_MODE=TRUE CONSOLE=true
|
||||
JVM_XX_OPTS="-XX:+UseG1GC" MEMORY="1G" \
|
||||
TYPE=VANILLA VERSION=LATEST FORGEVERSION=RECOMMENDED SPONGEBRANCH=STABLE SPONGEVERSION= FABRICVERSION=LATEST LEVEL=world \
|
||||
PVP=true DIFFICULTY=easy ENABLE_RCON=true RCON_PORT=25575 RCON_PASSWORD=minecraft \
|
||||
LEVEL_TYPE=DEFAULT GENERATOR_SETTINGS= WORLD= MODPACK= MODS= SERVER_PORT=25565 ONLINE_MODE=TRUE CONSOLE=true SERVER_NAME="Dedicated Server" \
|
||||
REPLACE_ENV_VARIABLES="FALSE" ENV_VARIABLE_PREFIX="CFG_"
|
||||
|
||||
COPY start* /
|
||||
RUN dos2unix /start* && chmod +x /start*
|
||||
|
||||
@@ -2,6 +2,8 @@
|
||||
[](https://hub.docker.com/r/itzg/minecraft-server/)
|
||||
[](https://hub.docker.com/r/itzg/minecraft-server/)
|
||||
[](https://github.com/itzg/dockerfiles/issues)
|
||||
[](https://gitter.im/itzg/dockerfiles)
|
||||
[](https://www.buymeacoffee.com/itzg)
|
||||
|
||||
This docker image provides a Minecraft Server that will automatically download the latest stable
|
||||
version at startup. You can also run/upgrade to any specific version or the
|
||||
@@ -34,6 +36,13 @@ With that you can easily view the logs, stop, or re-start the container:
|
||||
|
||||
docker start mc
|
||||
|
||||
## Looking for a Bedrock Dedicated Server
|
||||
|
||||
For Minecraft clients running on consoles, mobile, or native Windows, you'll need to
|
||||
use this image instead:
|
||||
|
||||
[itzg/minecraft-bedrock-server](https://hub.docker.com/r/itzg/minecraft-bedrock-server)
|
||||
|
||||
## Interacting with the server
|
||||
|
||||
[RCON](http://wiki.vg/RCON) is enabled by default, so you can `exec` into the container to
|
||||
@@ -201,6 +210,84 @@ This works well if you want to have a common set of modules in a separate
|
||||
location, but still have multiple worlds with different server requirements
|
||||
in either persistent volumes or a downloadable archive.
|
||||
|
||||
### Replacing variables inside configs
|
||||
|
||||
Sometimes you have mods or plugins that require configuration information that is only available at runtime.
|
||||
For example if you need to configure a plugin to connect to a database,
|
||||
you don't want to include this information in your Git repository or Docker image.
|
||||
Or maybe you have some runtime information like the server name that needs to be set
|
||||
in your config files after the container starts.
|
||||
|
||||
For those cases there is the option to replace defined variables inside your configs
|
||||
with environment variables defined at container runtime.
|
||||
|
||||
If you set the enviroment variable `REPLACE_ENV_VARIABLES` to `TRUE` the startup script
|
||||
will go thru all files inside your `/data` volume and replace variables that match your
|
||||
defined environment variables. Variables that you want to replace need to be wrapped
|
||||
inside `${YOUR_VARIABLE}` curly brackets and prefixed with a dollar sign. This is the regular
|
||||
syntax for enviromment variables inside strings or config files.
|
||||
|
||||
Optionally you can also define a prefix to only match predefined enviroment variables.
|
||||
|
||||
`ENV_VARIABLE_PREFIX="CFG_"` <-- this is the default prefix
|
||||
|
||||
There are some limitations to what characters you can use.
|
||||
|
||||
| Type | Allowed Characters |
|
||||
| ----- | ------------------- |
|
||||
| Name | `0-9a-zA-Z_-` |
|
||||
| Value | `0-9a-zA-Z_-:/=?.+` |
|
||||
|
||||
Here is a full example where we want to replace values inside a `database.yml`.
|
||||
|
||||
```yml
|
||||
...
|
||||
database:
|
||||
host: ${CFG_DB_HOST}
|
||||
name: ${CFG_DB_NAME}
|
||||
password: ${CFG_DB_PASSWORD}
|
||||
```
|
||||
|
||||
This is how your `docker-compose.yml` file could look like:
|
||||
|
||||
```yml
|
||||
version: '3'
|
||||
# Other docker-compose examples in /examples
|
||||
|
||||
services:
|
||||
minecraft:
|
||||
image: itzg/minecraft-server
|
||||
ports:
|
||||
- "25565:25565"
|
||||
volumes:
|
||||
- "mc:/data"
|
||||
environment:
|
||||
EULA: "TRUE"
|
||||
ENABLE_RCON: "true"
|
||||
RCON_PASSWORD: "testing"
|
||||
RCON_PORT: 28016
|
||||
# enable env variable replacement
|
||||
REPLACE_ENV_VARIABLES: "TRUE"
|
||||
# define an optional prefix for your env variables you want to replace
|
||||
ENV_VARIABLE_PREFIX: "CFG_"
|
||||
# and here are the actual variables
|
||||
CFG_DB_HOST: "http://localhost:3306"
|
||||
CFG_DB_NAME: "minecraft"
|
||||
CFG_DB_PASSWORD: "ug23u3bg39o-ogADSs"
|
||||
restart: always
|
||||
rcon:
|
||||
image: itzg/rcon
|
||||
ports:
|
||||
- "4326:4326"
|
||||
- "4327:4327"
|
||||
volumes:
|
||||
- "rcon:/opt/rcon-web-admin/db"
|
||||
|
||||
volumes:
|
||||
mc:
|
||||
rcon:
|
||||
```
|
||||
|
||||
## Running a Bukkit/Spigot server
|
||||
|
||||
Enable Bukkit/Spigot server mode by adding a `-e TYPE=BUKKIT -e VERSION=1.8` or `-e TYPE=SPIGOT -e VERSION=1.8` to your command-line.
|
||||
@@ -263,6 +350,15 @@ This works well if you want to have a common set of plugins in a separate
|
||||
location, but still have multiple worlds with different server requirements
|
||||
in either persistent volumes or a downloadable archive.
|
||||
|
||||
### Building an image with plugins
|
||||
|
||||
You can also create your own Docker images by extending the `itzg/minecraft-server` image.
|
||||
The image contains an `ONBUILD` trigger that will copy a `plugins.yml` file from you build directory and download any plugins specified in it.
|
||||
|
||||
You can read about the [`ToF-BuildTools` and how to use them here](https://git.faldoria.de/tof/server/build-tools).
|
||||
|
||||
You can also find [an example](examples/ToF-build/) with a custom image in the examples dir.
|
||||
|
||||
## Running a PaperSpigot server
|
||||
|
||||
Enable PaperSpigot server mode by adding a `-e TYPE=PAPER -e VERSION=1.9.4` to your command-line.
|
||||
@@ -283,6 +379,9 @@ If you are hosting your own copy of PaperSpigot you can override the download UR
|
||||
|
||||
You can install Bukkit plugins in two ways...
|
||||
|
||||
An example compose file is provided at
|
||||
[examples/docker-compose-paper.yml](examples/docker-compose-paper.yml).
|
||||
|
||||
### Using the /data volume
|
||||
|
||||
This is the easiest way if you are using a persistent `/data` mount.
|
||||
@@ -321,31 +420,39 @@ This works well if you want to have a common set of plugins in a separate
|
||||
location, but still have multiple worlds with different server requirements
|
||||
in either persistent volumes or a downloadable archive.
|
||||
|
||||
## Running a Server with a Feed-The-Beast (FTB) modpack
|
||||
## Running a Server with a Feed-The-Beast (FTB) / CurseForge modpack
|
||||
|
||||
Enable this server mode by adding a `-e TYPE=FTB` to your command-line,
|
||||
Enable this server mode by adding a `-e TYPE=FTB` or `-e TYPE=CURSEFORGE` to your command-line,
|
||||
but note the following additional steps needed...
|
||||
|
||||
You need to specify a modpack to run, using the `FTB_SERVER_MOD` environment
|
||||
variable. An FTB server modpack is available together with its respective
|
||||
client modpack on https://www.feed-the-beast.com under "Additional Files."
|
||||
Because of the interactive delayed download mechanism on that web site, you
|
||||
must manually download the server modpack. Copy the modpack to the `/data`
|
||||
You need to specify a modpack to run, using the `FTB_SERVER_MOD` or `CF_SERVER_MOD` environment
|
||||
variable. An FTB/CurseForge server modpack is available together with its respective
|
||||
client modpack on https://www.feed-the-beast.com under "Additional Files." Similar you can
|
||||
locate the modpacks for CurseForge at https://minecraft.curseforge.com/modpacks .
|
||||
|
||||
There are a couple of options for obtaining an FTB/CurseForge modpack.
|
||||
One options is that you can pre-download the **server** modpack and copy the modpack to the `/data`
|
||||
directory (see "Attaching data directory to host filesystem”).
|
||||
|
||||
Now you can add a `-e FTB_SERVER_MOD=name_of_modpack.zip` to your command-line.
|
||||
|
||||
$ docker run -d -v /path/on/host:/data -e TYPE=FTB \
|
||||
docker run -d -v /path/on/host:/data -e TYPE=FTB \
|
||||
-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
|
||||
Instead of pre-downloading a modpack from the FTB/CurseForge site, you
|
||||
can you set `FTB_SERVER_MOD` (or `CF_SERVER_MOD`) to the **server** URL of a modpack, such as
|
||||
|
||||
$ docker run ... \
|
||||
docker run ... \
|
||||
-e TYPE=FTB \
|
||||
-e FTB_SERVER_MOD=https://www.feed-the-beast.com/projects/ftb-infinity-lite-1-10/files/2402889
|
||||
|
||||
or for a CurseForce modpack:
|
||||
|
||||
docker run ... \
|
||||
-e TYPE=CURSEFORGE \
|
||||
-e CF_SERVER_MOD=https://minecraft.curseforge.com/projects/enigmatica2expert/files/2663153/download
|
||||
|
||||
### Using the /data volume
|
||||
|
||||
You must use a persistent `/data` mount for this type of server.
|
||||
@@ -378,6 +485,42 @@ then you apply a workaround by adding this to the run invocation:
|
||||
|
||||
-e FTB_LEGACYJAVAFIXER=true
|
||||
|
||||
### Using a client-made curseforge modpack
|
||||
|
||||
If you use something like curseforge, you may end up creating/using modpacks that do not
|
||||
contain server mod jars. Instead, the curseforge setup has `manifest.json` files, which
|
||||
will show up under `/data/FeedTheBeast/manifest.json`.
|
||||
|
||||
To use these packs you will need to:
|
||||
|
||||
- Specify the manifest location with env var `MANIFEST=/data/FeedTheBeast/manifest`
|
||||
- Pick a relevant ServerStart.sh and potentially settings.cfg and put them in `/data/FeedTheBeast`
|
||||
|
||||
An example of the latter would be to use https://github.com/AllTheMods/Server-Scripts
|
||||
There, you'll find that all you have to do is put `ServerStart.sh` and `settings.cfg` into
|
||||
`/data/FeedTheBeast`, taking care to update `settings.cfg` to specify your desired version
|
||||
of minecraft and forge. You can do this in the cli with something like:
|
||||
|
||||
```
|
||||
$ wget https://raw.githubusercontent.com/AllTheMods/Server-Scripts/master/ServerStart.sh
|
||||
$ wget https://raw.githubusercontent.com/AllTheMods/Server-Scripts/master/settings.cfg
|
||||
$ vim settings.cfg #update the forge version to the one you want. Your manifest.json will have it
|
||||
$ chmod +x ServerStart.sh
|
||||
$ docker run -itd --name derpcraft \
|
||||
-e MANIFEST=/data/FeedTheBeast/manifest.json \
|
||||
-v $PWD/ServerStart.sh:/data/FeedTheBeast/ServerStart.sh \
|
||||
-v $PWD/settings.cfg:/data/FeedTheBeast/settings.cfg \
|
||||
-e VERSION=1.12.2\
|
||||
-e TYPE=CURSEFORGE\
|
||||
-e CF_SERVER_MOD=https://minecraft.curseforge.com/projects/your_amazing_modpack/files/2670435/download\
|
||||
-p 25565:25565\
|
||||
-e EULA=TRUE\
|
||||
--restart=always\
|
||||
itzg/minecraft-server
|
||||
```
|
||||
|
||||
Note the `CF_SERVER_MOD` env var should match the url to download the modpack you are targeting.
|
||||
|
||||
## Running a SpongeVanilla server
|
||||
|
||||
Enable SpongeVanilla server mode by adding a `-e TYPE=SPONGEVANILLA` to your command-line.
|
||||
@@ -393,6 +536,95 @@ Just change it with `SPONGEBRANCH`, such as:
|
||||
$ docker run -d -v /path/on/host:/data ... \
|
||||
-e TYPE=SPONGEVANILLA -e SPONGEBRANCH=EXPERIMENTAL ...
|
||||
|
||||
## Running a Fabric Server
|
||||
|
||||
Enable Fabric server mode by adding a `-e TYPE=FABRIC` to your command-line.
|
||||
By default the container will run the latest version of [Fabric server](http://fabricmc.net/use/)
|
||||
but you can also choose to run a specific version with `-e FABRICVERSION=0.5.0.32`.
|
||||
|
||||
$ docker run -d -v /path/on/host:/data -e VERSION=1.14.3 \
|
||||
-e TYPE=FABRIC -e FABRICVERSION=0.5.0.32 \
|
||||
-p 25565:25565 -e EULA=TRUE --name mc itzg/minecraft-server
|
||||
|
||||
To use a pre-downloaded Fabric installer, place it in the attached `/data` directory and
|
||||
specify the name of the installer file with `FABRIC_INSTALLER`, such as:
|
||||
|
||||
$ docker run -d -v /path/on/host:/data ... \
|
||||
-e FABRIC_INSTALLER=fabric-installer-0.5.0.32.jar ...
|
||||
|
||||
To download a Fabric installer from a custom location, such as your own file repository, specify
|
||||
the URL with `FABRIC_INSTALLER_URL`, such as:
|
||||
|
||||
$ docker run -d -v /path/on/host:/data ... \
|
||||
-e FORGE_INSTALLER_URL=http://HOST/fabric-installer-0.5.0.32.jar ...
|
||||
|
||||
In both of the cases above, there is no need for the `VERSION` or `FABRICVERSION` variables.
|
||||
|
||||
In order to add mods, you have two options.
|
||||
|
||||
### Using the /data volume
|
||||
|
||||
This is the easiest way if you are using a persistent `/data` mount.
|
||||
|
||||
To do this, you will need to attach the container's `/data` directory
|
||||
(see "Attaching data directory to host filesystem”).
|
||||
Then, you can add mods to the `/path/on/host/mods` folder you chose. From the example above,
|
||||
the `/path/on/host` folder contents look like:
|
||||
|
||||
```
|
||||
/path/on/host
|
||||
├── mods
|
||||
│ └── ... INSTALL MODS HERE ...
|
||||
├── config
|
||||
│ └── ... CONFIGURE MODS HERE ...
|
||||
├── ops.json
|
||||
├── server.properties
|
||||
├── whitelist.json
|
||||
└── ...
|
||||
```
|
||||
|
||||
If you add mods while the container is running, you'll need to restart it to pick those
|
||||
up:
|
||||
|
||||
docker stop mc
|
||||
docker start mc
|
||||
|
||||
### Using separate mounts
|
||||
|
||||
This is the easiest way if you are using an ephemeral `/data` filesystem,
|
||||
or downloading a world with the `WORLD` option.
|
||||
|
||||
There are two additional volumes that can be mounted; `/mods` and `/config`.
|
||||
Any files in either of these filesystems will be copied over to the main
|
||||
`/data` filesystem before starting Minecraft.
|
||||
|
||||
This works well if you want to have a common set of modules in a separate
|
||||
location, but still have multiple worlds with different server requirements
|
||||
in either persistent volumes or a downloadable archive.
|
||||
|
||||
## Running with a custom server JAR
|
||||
|
||||
If you would like to run a custom server JAR, set `-e TYPE=CUSTOM` and pass the custom server
|
||||
JAR via `CUSTOM_SERVER`. It can either be a URL or a container path to an existing JAR file.
|
||||
|
||||
If it is a URL, it will only be downloaded into the `/data` directory if it wasn't already. As
|
||||
such, if you need to upgrade or re-download the JAR, then you will need to stop the container,
|
||||
remove the file from the container's `/data` directory, and start again.
|
||||
|
||||
## Force re-download of the server file
|
||||
|
||||
For VANILLA, FORGE, BUKKIT, SPIGOT, PAPER, CURSEFORGE, SPONGEVANILLA server types, set
|
||||
`$FORCE_REDOWNLOAD` to some value (e.g. 'true) to force a re-download of the server file for
|
||||
the particular server type. by adding a `-e FORCE_REDOWNLOAD=true` to your command-line.
|
||||
|
||||
For example, with PaperSpigot, it would look something like this:
|
||||
|
||||
```
|
||||
docker run -d -v /path/on/host:/data \
|
||||
-e TYPE=PAPER -e VERSION=1.14.1 -e FORCE_REDOWNLOAD=true \
|
||||
-p 25565:25565 -e EULA=TRUE --name mc itzg/minecraft-server
|
||||
```
|
||||
|
||||
## Using Docker Compose
|
||||
|
||||
Rather than type the server options below, the port mappings above, etc
|
||||
@@ -426,9 +658,29 @@ this server instance.
|
||||
|
||||
## Server configuration
|
||||
|
||||
By default the server configuration will be created and set based on the following
|
||||
environment variables, but only the first time the server is started. If the
|
||||
`server.properties` file already exists, the values in them will not be changed.
|
||||
|
||||
If you would like to override the server configuration each time the container
|
||||
starts up, you can set the OVERRIDE_SERVER_PROPERTIES environment variable like:
|
||||
|
||||
docker run -d -e OVERRIDE_SERVER_PROPERTIES=true ...
|
||||
|
||||
This will reset any manual configuration of the `server.properties` file, so if
|
||||
you want to make any persistent configuration changes you will need to make sure
|
||||
you have properly set the proper environment variables in your docker run command (described below).
|
||||
|
||||
### Server name
|
||||
|
||||
The server name (e.g. for bungeecord) can be set like:
|
||||
|
||||
docker run -d -e SERVER_NAME=MyServer ...
|
||||
|
||||
### Server port
|
||||
|
||||
The server port can be set like:
|
||||
|
||||
docker run -d -e SERVER_PORT=25565 ...
|
||||
|
||||
### Difficulty
|
||||
@@ -623,7 +875,7 @@ environment variable set to `false`, such as
|
||||
### Level Type and Generator Settings
|
||||
|
||||
By default, a standard world is generated with hills, valleys, water, etc. A different level type can
|
||||
be configured by setting `LEVEL_TYPE` to
|
||||
be configured by setting `LEVEL_TYPE` to an expected type, such as
|
||||
|
||||
* DEFAULT
|
||||
* FLAT
|
||||
@@ -674,6 +926,19 @@ will be deleted when the container is deleted.
|
||||
you should use an IP address or a globally resolveable FQDN, or else the
|
||||
name of a linked container.
|
||||
|
||||
### Cloning world from a container path
|
||||
|
||||
The `WORLD` option can also be used to reference a directory that will be used
|
||||
as a source to clone the world directory.
|
||||
|
||||
For example, the following would initially clone the world's content
|
||||
from `/worlds/basic`. Also notice in the example that you can use a
|
||||
read-only volume attachment to ensure the clone source remains pristine.
|
||||
|
||||
```
|
||||
docker run ... -v $HOME/worlds:/worlds:ro -e WORLD=/worlds/basic
|
||||
```
|
||||
|
||||
### Downloadable mod/plugin pack for Forge, Bukkit, and Spigot Servers
|
||||
|
||||
Like the `WORLD` option above, you can specify the URL of a "mod pack"
|
||||
@@ -686,6 +951,11 @@ 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.
|
||||
|
||||
You may also download individual mods using the `MODS` environment variable and supplying the URL
|
||||
to the jar files. Multiple mods/plugins should be comma separated.
|
||||
|
||||
docker run -d -e MODS=https://www.example.com/mods/mod1.jar,https://www.example.com/mods/mod2.jar ...
|
||||
|
||||
### Remove old mods/plugins
|
||||
|
||||
When the option above is specified (`MODPACK`) you can also instruct script to
|
||||
@@ -695,10 +965,8 @@ To use this option pass the environment variable `REMOVE_OLD_MODS="TRUE"`, such
|
||||
|
||||
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.
|
||||
before unpacking new content from the MODPACK or MODS.
|
||||
|
||||
### Online mode
|
||||
|
||||
@@ -717,7 +985,11 @@ Allows users to use flight on your server while in Survival mode, if they have a
|
||||
### Running as alternate user/group ID
|
||||
|
||||
By default, the container will switch to user ID 1000 and group ID 1000;
|
||||
however, you can override those values by setting `UID` and `GID`, respectively.
|
||||
however, you can override those values by setting `UID` and/or `GID` as environmental entries, during the `docker run` command.
|
||||
|
||||
-e UID=1234
|
||||
-e GID=1234
|
||||
|
||||
The container will also skip user switching if the `--user`/`-u` argument
|
||||
is passed to `docker run`.
|
||||
|
||||
@@ -740,6 +1012,9 @@ General JVM options can be passed to the Minecraft Server invocation by passing
|
||||
environment variable. Options like `-X` that need to proceed general JVM options can be passed
|
||||
via a `JVM_XX_OPTS` environment variable.
|
||||
|
||||
For some cases, if e.g. after removing mods, it could be necessary to startup minecraft with an additional `-D` parameter like `-Dfml.queryResult=confirm`. To address this you can use the environment variable `JVM_DD_OPTS`, which builds the params from a given list of values separated by space, but without the `-D` prefix. To make things running under systems (e.g. Plesk), which doesn't allow `=` inside values, a `:` (colon) could be used instead. The upper example would look like this:
|
||||
`JVM_DD_OPTS=fml.queryResult:confirm`, and will be converted to `-Dfml.queryResult=confirm`.
|
||||
|
||||
### HTTP Proxy
|
||||
|
||||
You may configure the use of an HTTP/HTTPS proxy by passing the proxy's URL via the `PROXY`
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
version: '3'
|
||||
# Other docker-compose examples in /examples
|
||||
|
||||
services:
|
||||
minecraft:
|
||||
|
||||
3
minecraft-server/examples/ToF-build/Dockerfile
Normal file
3
minecraft-server/examples/ToF-build/Dockerfile
Normal file
@@ -0,0 +1,3 @@
|
||||
FROM itzg/minecraft-server
|
||||
|
||||
ENV TYPE=SPIGOT
|
||||
13
minecraft-server/examples/ToF-build/plugins.yml
Normal file
13
minecraft-server/examples/ToF-build/plugins.yml
Normal file
@@ -0,0 +1,13 @@
|
||||
plugins:
|
||||
worldedit:
|
||||
file: WorldEdit.jar
|
||||
url: https://dev.bukkit.org/projects/worldedit/files/latest
|
||||
FastAsyncWorldEdit:
|
||||
file: FastAsyncWorldEdit.jar
|
||||
url: https://empcraft.com/fawe/latest.php?bukkit
|
||||
worldguard:
|
||||
file: WorldGuard.jar
|
||||
url: https://dev.bukkit.org/projects/worldguard/files/latest
|
||||
citizens:
|
||||
file: Citizens.jar
|
||||
url: https://dev.bukkit.org/projects/citizens/files/latest
|
||||
17
minecraft-server/examples/docker-compose-paper.yml
Normal file
17
minecraft-server/examples/docker-compose-paper.yml
Normal file
@@ -0,0 +1,17 @@
|
||||
version: '3.7'
|
||||
|
||||
services:
|
||||
mc:
|
||||
image: itzg/minecraft-server
|
||||
environment:
|
||||
EULA: "true"
|
||||
TYPE: PAPER
|
||||
VERSION: 1.9.4
|
||||
command: --noconsole
|
||||
ports:
|
||||
- 25565:25565
|
||||
volumes:
|
||||
- mc-paper:/data
|
||||
|
||||
volumes:
|
||||
mc-paper:
|
||||
34
minecraft-server/examples/docker-compose-spongeforge.yml
Normal file
34
minecraft-server/examples/docker-compose-spongeforge.yml
Normal file
@@ -0,0 +1,34 @@
|
||||
version: '3'
|
||||
# Forge with Sponge API support. THIS REQUIRES DOWNLOADING SPONGEFORGE.
|
||||
# Place the SpongeForge jar file in /data/mods. Other Forge mods go here as well.
|
||||
# Place Sponge mods in /data/mods/plugins. Yes, this is a directory inside the Forge mod directory. Do NOT use /data/plugins.
|
||||
|
||||
services:
|
||||
minecraft:
|
||||
image: itzg/minecraft-server
|
||||
ports:
|
||||
- "25565:25565"
|
||||
volumes:
|
||||
- "mc:/data"
|
||||
environment:
|
||||
EULA: "TRUE"
|
||||
#VERSION: "1.12.2" (Ensure this is compatbile with the version of SpongeForge you are using!)
|
||||
TYPE: "FORGE"
|
||||
FORGEVERSION: "RECOMMENDED"
|
||||
#FORGEVERSION: "14.23.5.2807"
|
||||
CONSOLE: "false"
|
||||
ENABLE_RCON: "true"
|
||||
RCON_PASSWORD: "testing"
|
||||
RCON_PORT: 28016
|
||||
restart: unless-stopped
|
||||
rcon:
|
||||
image: itzg/rcon
|
||||
ports:
|
||||
- "4326:4326"
|
||||
- "4327:4327"
|
||||
volumes:
|
||||
- "rcon:/opt/rcon-web-admin/db"
|
||||
|
||||
volumes:
|
||||
mc:
|
||||
rcon:
|
||||
9
minecraft-server/start
Executable file → Normal file
9
minecraft-server/start
Executable file → Normal file
@@ -1,11 +1,14 @@
|
||||
#!/bin/bash
|
||||
|
||||
umask 0002
|
||||
chmod g+w /data
|
||||
|
||||
if [ $(id -u) = 0 ]; then
|
||||
if [[ -v UID && $UID != $(id -u) ]]; then
|
||||
usermod -u $UID minecraft
|
||||
fi
|
||||
if [[ -v GID ]]; then
|
||||
groupmod -g $GID minecraft
|
||||
groupmod -o -g $GID minecraft
|
||||
fi
|
||||
|
||||
if [[ $(stat -c "%u" /data) != $UID ]]; then
|
||||
@@ -13,7 +16,7 @@ if [ $(id -u) = 0 ]; then
|
||||
chown -R minecraft:minecraft /data
|
||||
fi
|
||||
|
||||
su-exec minecraft:minecraft /start-configuration
|
||||
exec su-exec minecraft:minecraft /start-configuration $@
|
||||
else
|
||||
exec /start-configuration
|
||||
exec /start-configuration $@
|
||||
fi
|
||||
|
||||
8
minecraft-server/start-configuration
Executable file → Normal file
8
minecraft-server/start-configuration
Executable file → Normal file
@@ -77,6 +77,10 @@ case "${TYPE^^}" in
|
||||
exec /start-deployForge $@
|
||||
;;
|
||||
|
||||
FABRIC)
|
||||
exec /start-deployFabric $@
|
||||
;;
|
||||
|
||||
FTB|CURSEFORGE)
|
||||
exec /start-deployFTB $@
|
||||
;;
|
||||
@@ -89,6 +93,10 @@ case "${TYPE^^}" in
|
||||
exec /start-deploySpongeVanilla $@
|
||||
;;
|
||||
|
||||
CUSTOM)
|
||||
exec /start-deployCustom $@
|
||||
;;
|
||||
|
||||
*)
|
||||
echo "Invalid type: '$TYPE'"
|
||||
echo "Must be: VANILLA, FORGE, BUKKIT, SPIGOT, PAPER, FTB, CURSEFORGE, SPONGEVANILLA"
|
||||
|
||||
15
minecraft-server/start-deployBukkitSpigot
Executable file → Normal file
15
minecraft-server/start-deployBukkitSpigot
Executable file → Normal file
@@ -1,12 +1,21 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -e
|
||||
|
||||
function buildSpigotFromSource {
|
||||
echo "Building Spigot $VANILLA_VERSION from source, might take a while, get some coffee"
|
||||
mkdir /data/temp
|
||||
cd /data/temp
|
||||
|
||||
jvmOpts="-Xms${INIT_MEMORY:-$MEMORY} -Xmx${MAX_MEMORY:-$MEMORY}"
|
||||
|
||||
curl -sSL -o /data/temp/BuildTools.jar https://hub.spigotmc.org/jenkins/job/BuildTools/lastSuccessfulBuild/artifact/target/BuildTools.jar && \
|
||||
java -jar /data/temp/BuildTools.jar --rev $VANILLA_VERSION 2>&1 |tee /data/spigot_build.log| while read l; do echo -n .; done; echo "done"
|
||||
mv spigot-*.jar /data/spigot_server.jar
|
||||
java $jvmOpts -jar /data/temp/BuildTools.jar --rev $VANILLA_VERSION 2>&1 |tee /data/spigot_build.log| while read l; do echo -n .; done; echo "done"
|
||||
if ! mv spigot-*.jar /data/spigot_server.jar; then
|
||||
echo "ERR failed to build Spigot"
|
||||
cat /data/spigot_build.log
|
||||
exit 1
|
||||
fi
|
||||
mv craftbukkit-*.jar /data/craftbukkit_server.jar
|
||||
echo "Cleaning up"
|
||||
rm -rf /data/temp
|
||||
@@ -63,7 +72,7 @@ case "$TYPE" in
|
||||
;;
|
||||
esac
|
||||
|
||||
if [ ! -f $SERVER ]; then
|
||||
if [ ! -f $SERVER ] || [ -n "$FORCE_REDOWNLOAD" ]; then
|
||||
if [[ "$BUILD_SPIGOT_FROM_SOURCE" = TRUE || "$BUILD_SPIGOT_FROM_SOURCE" = true || "$BUILD_FROM_SOURCE" = TRUE || "$BUILD_FROM_SOURCE" = true ]]; then
|
||||
buildSpigotFromSource
|
||||
else
|
||||
|
||||
29
minecraft-server/start-deployCustom
Normal file
29
minecraft-server/start-deployCustom
Normal file
@@ -0,0 +1,29 @@
|
||||
#!/bin/bash
|
||||
|
||||
. /start-utils
|
||||
|
||||
if isURL ${CUSTOM_SERVER}; then
|
||||
filename=$(basename ${CUSTOM_SERVER})
|
||||
export SERVER=/data/${filename}
|
||||
|
||||
if [[ -f ${SERVER} ]] || [ -n "$FORCE_REDOWNLOAD" ]; then
|
||||
echo "Using previously downloaded jar at ${SERVER}"
|
||||
else
|
||||
echo "Downloading custom server jar from ${CUSTOM_SERVER} ..."
|
||||
if ! curl -sSL -o ${SERVER} ${CUSTOM_SERVER}; then
|
||||
echo "Failed to download from ${CUSTOM_SERVER}"
|
||||
exit 2
|
||||
fi
|
||||
fi
|
||||
|
||||
elif [[ -f ${CUSTOM_SERVER} ]]; then
|
||||
echo "Using custom server jar at ${CUSTOM_SERVER} ..."
|
||||
export SERVER=${CUSTOM_SERVER}
|
||||
|
||||
else
|
||||
echo "CUSTOM_SERVER is not properly set to a URL or existing jar file"
|
||||
exit 2
|
||||
fi
|
||||
|
||||
# Continue to Final Setup
|
||||
exec /start-finalSetup01World $@
|
||||
67
minecraft-server/start-deployFTB
Executable file → Normal file
67
minecraft-server/start-deployFTB
Executable file → Normal file
@@ -6,7 +6,9 @@ export FTB_BASE_DIR=/data/FeedTheBeast
|
||||
legacyJavaFixerUrl=http://ftb.cursecdn.com/FTB2/maven/net/minecraftforge/lex/legacyjavafixer/1.0/legacyjavafixer-1.0.jar
|
||||
export TYPE=FEED-THE-BEAST
|
||||
|
||||
echo "Looking for Feed-The-Beast server modpack."
|
||||
FTB_SERVER_MOD=${FTB_SERVER_MOD:-$CF_SERVER_MOD}
|
||||
|
||||
echo "Looking for Feed-The-Beast / CurseForge server modpack."
|
||||
if [[ -z $FTB_SERVER_MOD ]]; then
|
||||
echo "Environment variable FTB_SERVER_MOD not set."
|
||||
echo "Set FTB_SERVER_MOD to the file name of the FTB server modpack."
|
||||
@@ -14,8 +16,10 @@ if [[ -z $FTB_SERVER_MOD ]]; then
|
||||
exit 2
|
||||
fi
|
||||
|
||||
entryScriptExpr="-name ServerStart.sh -o -name ServerStartLinux.sh -o -name LaunchServer.sh"
|
||||
|
||||
if [[ -d ${FTB_BASE_DIR} ]]; then
|
||||
startScriptCount=$(find ${FTB_BASE_DIR} -name ServerStart.sh |wc -l)
|
||||
startScriptCount=$(find ${FTB_BASE_DIR} $entryScriptExpr |wc -l)
|
||||
if [[ $startScriptCount > 1 ]]; then
|
||||
echo "Conflicting FTB/CurseForge packages have been installed. Please cleanup ${FTB_BASE_DIR}"
|
||||
exit 2
|
||||
@@ -31,8 +35,10 @@ if [[ $startScriptCount = 0 ]]; then
|
||||
srv_modpack=${FTB_SERVER_MOD}
|
||||
if isURL ${srv_modpack}; then
|
||||
case $srv_modpack in
|
||||
https://www.feed-the-beast.com/*/download)
|
||||
https://www.feed-the-beast.com/*/download|https://www.curseforge.com/minecraft/modpacks/*/download/*/file)
|
||||
;;
|
||||
https://www.curseforge.com/minecraft/modpacks/*/download/*)
|
||||
srv_modpack=${srv_modpack}/file;;
|
||||
https://www.feed-the-beast.com/*)
|
||||
srv_modpack=${srv_modpack}/download;;
|
||||
esac
|
||||
@@ -68,30 +74,55 @@ if [[ $startScriptCount = 0 ]]; then
|
||||
unzip -o ${srv_modpack} -d ${FTB_BASE_DIR} | awk '{printf "."} END {print ""}'
|
||||
fi
|
||||
|
||||
if [[ $(find ${FTB_BASE_DIR} -name ServerStart.sh |wc -l) = 0 ]]; then
|
||||
if [[ $(find ${FTB_BASE_DIR} $entryScriptExpr | wc -l) = 0 ]]; then
|
||||
|
||||
forgeJar=$(find ${FTB_BASE_DIR} -name 'forge*.jar' -a -not -name 'forge*installer')
|
||||
if [[ "$forgeJar" ]]; then
|
||||
export FTB_BASE_DIR=$(dirname "${forgeJar}")
|
||||
echo "No entry script found, so building one for ${forgeJar}"
|
||||
cat > "${FTB_BASE_DIR}/ServerStart.sh" <<EOF
|
||||
#!/bin/sh
|
||||
. ./settings-local.sh
|
||||
java \${JAVA_PARAMETERS} -Xmx\${MAX_RAM} -jar $(basename "${forgeJar}") nogui
|
||||
EOF
|
||||
chmod +x "${FTB_BASE_DIR}/ServerStart.sh"
|
||||
else
|
||||
echo "Please make sure you are using the server version of the FTB modpack!"
|
||||
exit 2
|
||||
fi
|
||||
fi
|
||||
|
||||
scriptCount=$(find "${FTB_BASE_DIR}" $entryScriptExpr | wc -l)
|
||||
if [[ $scriptCount = 0 ]]; then
|
||||
echo "Please make sure you are using the server version of the FTB modpack!"
|
||||
exit 2
|
||||
elif [[ $scriptCount > 1 ]]; then
|
||||
echo "Ambigous startup scripts in FTB modpack!"
|
||||
echo "found:"
|
||||
find ${FTB_BASE_DIR} $entryScriptExpr
|
||||
exit 2
|
||||
fi
|
||||
|
||||
export FTB_SERVER_START=./ServerStart.sh
|
||||
export FTB_DIR=$(dirname $(find ${FTB_DIR} -name ServerStart.sh))
|
||||
chmod a+x ${FTB_DIR}/${FTB_SERVER_START}
|
||||
sed -i 's/-jar/-Dfml.queryResult=confirm -jar/' ${FTB_DIR}/${FTB_SERVER_START}
|
||||
sed -i 's/.*read.*Restart now/#\0/' ${FTB_DIR}/${FTB_SERVER_START}
|
||||
legacyJavaFixerPath=${FTB_DIR}/mods/legacyjavafixer.jar
|
||||
export FTB_SERVER_START=$(find "${FTB_BASE_DIR}" $entryScriptExpr)
|
||||
|
||||
if isTrue ${FTB_LEGACYJAVAFIXER} && [ ! -e ${legacyJavaFixerPath} ]; then
|
||||
export FTB_DIR=$(dirname "${FTB_SERVER_START}")
|
||||
chmod a+x "${FTB_SERVER_START}"
|
||||
sed -i 's/-jar/-Dfml.queryResult=confirm -jar/' "${FTB_SERVER_START}"
|
||||
sed -i 's/.*read.*Restart now/#\0/' "${FTB_SERVER_START}"
|
||||
legacyJavaFixerPath="${FTB_DIR}/mods/legacyjavafixer.jar"
|
||||
|
||||
if isTrue ${FTB_LEGACYJAVAFIXER} && [ ! -e "${legacyJavaFixerPath}" ]; then
|
||||
echo "Installing legacy java fixer to ${legacyJavaFixerPath}"
|
||||
curl -sSL -o ${legacyJavaFixerPath} ${legacyJavaFixerUrl}
|
||||
curl -sSL -o "${legacyJavaFixerPath}" ${legacyJavaFixerUrl}
|
||||
fi
|
||||
|
||||
if [ -e ${FTB_DIR}/FTBInstall.sh ]; then
|
||||
pushd ${FTB_DIR}
|
||||
sh ${FTB_DIR}/FTBInstall.sh
|
||||
if [ -e "${FTB_DIR}/FTBInstall.sh" ]; then
|
||||
pushd "${FTB_DIR}"
|
||||
sh FTBInstall.sh
|
||||
popd
|
||||
elif [ -e ${FTB_DIR}/Install.sh ]; then
|
||||
pushd ${FTB_DIR}
|
||||
sh ${FTB_DIR}/Install.sh
|
||||
elif [ -e "${FTB_DIR}/Install.sh" ]; then
|
||||
pushd "${FTB_DIR}"
|
||||
sh Install.sh
|
||||
popd
|
||||
fi
|
||||
|
||||
|
||||
72
minecraft-server/start-deployFabric
Normal file
72
minecraft-server/start-deployFabric
Normal file
@@ -0,0 +1,72 @@
|
||||
#!/bin/bash
|
||||
set -u
|
||||
|
||||
export TYPE=FABRIC
|
||||
|
||||
FABRIC_INSTALLER=${FABRIC_INSTALLER:-}
|
||||
FABRIC_INSTALLER_URL=${FABRIC_INSTALLER_URL:-}
|
||||
FABRICVERSION=${FABRICVERSION:-LATEST}
|
||||
if [[ -z $FABRIC_INSTALLER && -z $FABRIC_INSTALLER_URL ]]; then
|
||||
echo "Checking Fabric version information."
|
||||
case $FABRICVERSION in
|
||||
LATEST)
|
||||
curl -fsSL https://maven.fabricmc.net/net/fabricmc/fabric-installer/maven-metadata.xml | xq -c . > /tmp/fabric.json
|
||||
FABRIC_VERSION=$(< /tmp/fabric.json jq -r ".metadata.versioning.release")
|
||||
;;
|
||||
|
||||
*)
|
||||
FABRIC_VERSION=$FABRICVERSION
|
||||
;;
|
||||
esac
|
||||
|
||||
FABRIC_INSTALLER="/tmp/fabric-installer-$FABRIC_VERSION.jar"
|
||||
|
||||
elif [[ -z $FABRIC_INSTALLER ]]; then
|
||||
FABRIC_INSTALLER="/tmp/fabric-installer.jar"
|
||||
elif [[ ! -e $FABRIC_INSTALLER ]]; then
|
||||
echo "ERROR: the given Fabric installer doesn't exist : $FABRIC_INSTALLER"
|
||||
exit 2
|
||||
fi
|
||||
|
||||
installMarker=".fabric-installed-${FABRIC_VERSION:-manual}"
|
||||
|
||||
if [[ ! -e $installMarker ]]; then
|
||||
if [[ ! -e $FABRIC_INSTALLER ]]; then
|
||||
if [[ -z $FABRIC_INSTALLER_URL ]]; then
|
||||
echo "Downloading $FABRIC_VERSION"
|
||||
downloadUrl="https://maven.fabricmc.net/net/fabricmc/fabric-installer/$FABRIC_VERSION/fabric-installer-$FABRIC_VERSION.jar"
|
||||
echo "...trying $downloadUrl"
|
||||
curl -o $FABRIC_INSTALLER -fsSL $downloadUrl
|
||||
else
|
||||
echo "Downloading $FABRIC_INSTALLER_URL ..."
|
||||
if ! curl -o $FABRIC_INSTALLER -fsSL $FABRIC_INSTALLER_URL; then
|
||||
echo "Failed to download from given location $FABRIC_INSTALLER_URL"
|
||||
exit 2
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
echo "Installing Fabric $FABRIC_VERSION using $FABRIC_INSTALLER"
|
||||
tries=3
|
||||
set +e
|
||||
while ((--tries >= 0)); do
|
||||
java -jar $FABRIC_INSTALLER server -version $VANILLA_VERSION -downloadMinecraft
|
||||
if [[ $? == 0 ]]; then
|
||||
break
|
||||
fi
|
||||
done
|
||||
set -e
|
||||
if (($tries < 0)); then
|
||||
echo "Fabric failed to install after several tries." >&2
|
||||
exit 10
|
||||
fi
|
||||
export SERVER=fabric-server-launch.jar
|
||||
echo "Using server $SERVER"
|
||||
echo $SERVER > $installMarker
|
||||
|
||||
else
|
||||
export SERVER=$(< $installMarker)
|
||||
fi
|
||||
|
||||
# Contineut to Final Setup
|
||||
exec /start-finalSetup01World $@
|
||||
6
minecraft-server/start-deployForge
Executable file → Normal file
6
minecraft-server/start-deployForge
Executable file → Normal file
@@ -12,12 +12,6 @@ if [[ -z $FORGE_INSTALLER && -z $FORGE_INSTALLER_URL ]]; then
|
||||
norm=${VANILLA_VERSION}.0 ;;
|
||||
esac
|
||||
|
||||
################### TEMPORORAY LOGIC util forge is generally available for 1.13
|
||||
|
||||
if [[ $VERSION = LATEST ]]; then
|
||||
VANILLA_VERSION=1.12.2
|
||||
fi
|
||||
|
||||
#################################################################################
|
||||
|
||||
echo "Checking Forge version information."
|
||||
|
||||
36
minecraft-server/start-deployPaper
Executable file → Normal file
36
minecraft-server/start-deployPaper
Executable file → Normal file
@@ -1,46 +1,14 @@
|
||||
#!/bin/bash
|
||||
|
||||
export SERVER=paper_server.jar
|
||||
if [ ! -f $SERVER ]; then
|
||||
job=PaperSpigot
|
||||
case "${VANILLA_VERSION}" in
|
||||
1.13.*)
|
||||
job=Paper-1.13
|
||||
build="lastSuccessfulBuild"
|
||||
;;
|
||||
1.12.2)
|
||||
build="lastSuccessfulBuild";;
|
||||
1.11.2)
|
||||
build="1104";;
|
||||
1.10.2)
|
||||
build="916";;
|
||||
1.9.4)
|
||||
build="773";;
|
||||
1.9.2)
|
||||
build="727";;
|
||||
1.9)
|
||||
build="612";;
|
||||
1.8.8)
|
||||
build="443";;
|
||||
*)
|
||||
build="nosupp";;
|
||||
esac
|
||||
|
||||
if [ $build != "nosupp" ]; then
|
||||
rm -f $SERVER
|
||||
downloadUrl=${PAPER_DOWNLOAD_URL:-https://ci.destroystokyo.com/job/$job/$build/artifact/paperclip.jar}
|
||||
if [ ! -f $SERVER ] || [ -n "$FORCE_REDOWNLOAD" ]; then
|
||||
downloadUrl=${PAPER_DOWNLOAD_URL:-https://papermc.io/api/v1/paper/${VANILLA_VERSION}/latest/download}
|
||||
echo "Downloading Paper $VANILLA_VERSION from $downloadUrl ..."
|
||||
curl -fsSL -o $SERVER "$downloadUrl"
|
||||
if [ ! -f $SERVER ]; then
|
||||
echo "ERROR: failed to download from $downloadUrl (status=$?)"
|
||||
exit 3
|
||||
fi
|
||||
else
|
||||
echo "ERROR: Version $VERSION is not supported for $TYPE"
|
||||
echo " Refer to https://ci.destroystokyo.com/job/PaperSpigot/"
|
||||
echo " for supported versions"
|
||||
exit 2
|
||||
fi
|
||||
fi
|
||||
|
||||
# Normalize on Spigot for operations below
|
||||
|
||||
2
minecraft-server/start-deploySpongeVanilla
Executable file → Normal file
2
minecraft-server/start-deploySpongeVanilla
Executable file → Normal file
@@ -28,7 +28,7 @@ fi
|
||||
|
||||
export SERVER="spongevanilla-$SPONGEVERSION.jar"
|
||||
|
||||
if [ ! -e $SERVER ]; then
|
||||
if [ ! -e $SERVER ] || [ -n "$FORCE_REDOWNLOAD" ]; then
|
||||
echo "Downloading $SERVER ..."
|
||||
curl -sSL -o $SERVER https://repo.spongepowered.org/maven/org/spongepowered/$TYPE/$SPONGEVERSION/$SERVER
|
||||
fi
|
||||
|
||||
38
minecraft-server/start-deployVanilla
Executable file → Normal file
38
minecraft-server/start-deployVanilla
Executable file → Normal file
@@ -1,10 +1,42 @@
|
||||
#!/bin/bash
|
||||
|
||||
export SERVER="minecraft_server.$VANILLA_VERSION.jar"
|
||||
. /start-utils
|
||||
set -o pipefail
|
||||
|
||||
if [ ! -e $SERVER ]; then
|
||||
export SERVER="minecraft_server.${VANILLA_VERSION// /_}.jar"
|
||||
|
||||
if [ ! -e $SERVER ] || [ -n "$FORCE_REDOWNLOAD" ]; then
|
||||
echo "Downloading $SERVER ..."
|
||||
curl -sSL -o $SERVER $(curl -s $(curl -s 'https://launchermeta.mojang.com/mc/game/version_manifest.json' | jq --arg VANILLA_VERSION "$VANILLA_VERSION" --raw-output '[.versions[]|select(.id == $VANILLA_VERSION)][0].url') | jq --raw-output '.downloads.server.url')
|
||||
debug "Finding version manifest for $VANILLA_VERSION"
|
||||
versionManifestUrl=$(curl -fsSL 'https://launchermeta.mojang.com/mc/game/version_manifest.json' | jq --arg VANILLA_VERSION "$VANILLA_VERSION" --raw-output '[.versions[]|select(.id == $VANILLA_VERSION)][0].url')
|
||||
result=$?
|
||||
if [ $result != 0 ]; then
|
||||
echo "ERROR failed to obtain version manifest URL ($result)"
|
||||
exit 1
|
||||
fi
|
||||
if [ $versionManifestUrl = "null" ]; then
|
||||
echo "ERROR couldn't find a matching manifest entry for $VANILLA_VERSION"
|
||||
exit 1
|
||||
fi
|
||||
debug "Found version manifest at $versionManifestUrl"
|
||||
|
||||
serverDownloadUrl=$(curl -fsSL ${versionManifestUrl} | jq --raw-output '.downloads.server.url')
|
||||
result=$?
|
||||
if [ $result != 0 ]; then
|
||||
echo "ERROR failed to obtain version manifest from $versionManifestUrl ($result)"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
debug "Downloading server from $serverDownloadUrl"
|
||||
if isDebugging; then
|
||||
verbose=-v
|
||||
fi
|
||||
curl $verbose -fsSL -o $SERVER $serverDownloadUrl
|
||||
result=$?
|
||||
if [ $result != 0 ]; then
|
||||
echo "ERROR failed to download server from $serverDownloadUrl ($result)"
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
# Continue to Final Setup
|
||||
|
||||
29
minecraft-server/start-finalSetup01World
Executable file → Normal file
29
minecraft-server/start-finalSetup01World
Executable file → Normal file
@@ -1,7 +1,13 @@
|
||||
#!/bin/bash
|
||||
|
||||
# If supplied with a URL for a world, download it and unpack
|
||||
if [[ "$WORLD" ]]; then
|
||||
if [ $TYPE = "FEED-THE-BEAST" ]; then
|
||||
worldDest=$FTB_BASE_DIR/$LEVEL
|
||||
else
|
||||
worldDest=/data/$LEVEL
|
||||
fi
|
||||
|
||||
# If no world exists and a URL for a world is supplied, download it and unpack
|
||||
if [[ "$WORLD" ]] && [ ! -d "$worldDest" ]; then
|
||||
case "X$WORLD" in
|
||||
X[Hh][Tt][Tt][Pp]*)
|
||||
echo "Downloading world from $WORLD"
|
||||
@@ -9,25 +15,34 @@ case "X$WORLD" in
|
||||
echo "Unzipping world"
|
||||
unzip -o -q /data/world.zip
|
||||
rm -f /data/world.zip
|
||||
if [ ! -d /data/world ]; then
|
||||
if [ ! -d $worldDest ]; then
|
||||
echo World directory not found
|
||||
for i in /data/*/level.dat; do
|
||||
if [ -f "$i" ]; then
|
||||
d=`dirname "$i"`
|
||||
echo Renaming world directory from $d
|
||||
mv -f "$d" /data/world
|
||||
mv -f "$d" $worldDest
|
||||
fi
|
||||
done
|
||||
fi
|
||||
if [ "$TYPE" = "SPIGOT" ]; then
|
||||
# Reorganise if a Spigot server
|
||||
echo "Moving End and Nether maps to Spigot location"
|
||||
[ -d "/data/world/DIM1" ] && mv -f "/data/world/DIM1" "/data/world_the_end"
|
||||
[ -d "/data/world/DIM-1" ] && mv -f "/data/world/DIM-1" "/data/world_nether"
|
||||
[ -d "$worldDest/DIM1" ] && mv -f "$worldDest/DIM1" "/data/${LEVEL}_the_end"
|
||||
[ -d "$worldDest/DIM-1" ] && mv -f "$worldDest/DIM-1" "/data/${LEVEL}_nether"
|
||||
fi
|
||||
;;
|
||||
*)
|
||||
echo "Invalid URL given for world: Must be HTTP or HTTPS and a ZIP file"
|
||||
if [[ -d $WORLD ]]; then
|
||||
if [[ ! -d $worldDest ]]; then
|
||||
echo "Cloning world directory from $WORLD ..."
|
||||
cp -r $WORLD $worldDest
|
||||
else
|
||||
echo "Skipping clone from $WORLD since $worldDest exists"
|
||||
fi
|
||||
else
|
||||
echo "Invalid URL given for world: Must be HTTP or HTTPS and a ZIP file"
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
|
||||
93
minecraft-server/start-finalSetup02Modpack
Executable file → Normal file
93
minecraft-server/start-finalSetup02Modpack
Executable file → Normal file
@@ -1,31 +1,38 @@
|
||||
#!/bin/bash
|
||||
|
||||
# CURSE_URL_BASE used in manifest downloads below
|
||||
CURSE_URL_BASE=${CURSE_URL_BASE:-https://minecraft.curseforge.com/projects}
|
||||
|
||||
# Remove old mods/plugins
|
||||
if [ "$REMOVE_OLD_MODS" = "TRUE" ]; then
|
||||
if [ "$TYPE" = "SPIGOT" ]; then
|
||||
rm -rf /data/plugins/*
|
||||
else
|
||||
rm -rf /data/mods/*
|
||||
fi
|
||||
fi
|
||||
|
||||
# If supplied with a URL for a modpack (simple zip of jars), download it and unpack
|
||||
if [[ "$MODPACK" ]]; then
|
||||
case "X$MODPACK" in
|
||||
EFFECTIVE_MODPACK_URL=$(curl -Ls -o /dev/null -w %{url_effective} $MODPACK)
|
||||
case "X$EFFECTIVE_MODPACK_URL" in
|
||||
X[Hh][Tt][Tt][Pp]*.zip)
|
||||
echo "Downloading mod/plugin pack via HTTP"
|
||||
echo " from $MODPACK ..."
|
||||
if ! curl -sSL -o /tmp/modpack.zip "$MODPACK"; then
|
||||
echo "ERROR: failed to download from $MODPACK"
|
||||
echo " from $EFFECTIVE_MODPACK_URL ..."
|
||||
if ! curl -sSL -o /tmp/modpack.zip "$EFFECTIVE_MODPACK_URL"; then
|
||||
echo "ERROR: failed to download from $EFFECTIVE_MODPACK_URL"
|
||||
exit 2
|
||||
fi
|
||||
|
||||
if [ "$TYPE" = "SPIGOT" ]; then
|
||||
if [ "$REMOVE_OLD_MODS" = "TRUE" ]; then
|
||||
rm -rf /data/plugins/*
|
||||
fi
|
||||
mkdir -p /data/plugins
|
||||
if ! unzip -o -d /data/plugins /tmp/modpack.zip; then
|
||||
echo "ERROR: failed to unzip the modpack from $MODPACK"
|
||||
echo "ERROR: failed to unzip the modpack from $EFFECTIVE_MODPACK_URL"
|
||||
fi
|
||||
else
|
||||
if [ "$REMOVE_OLD_MODS" = "TRUE" ]; then
|
||||
rm -rf /data/mods/*
|
||||
fi
|
||||
mkdir -p /data/mods
|
||||
if ! unzip -o -d /data/mods /tmp/modpack.zip; then
|
||||
echo "ERROR: failed to unzip the modpack from $MODPACK"
|
||||
echo "ERROR: failed to unzip the modpack from $EFFECTIVE_MODPACK_URL"
|
||||
fi
|
||||
fi
|
||||
rm -f /tmp/modpack.zip
|
||||
@@ -36,4 +43,66 @@ case "X$MODPACK" in
|
||||
esac
|
||||
fi
|
||||
|
||||
# If supplied with a URL for a plugin download it.
|
||||
if [[ "$MODS" ]]; then
|
||||
for i in ${MODS//,/ }
|
||||
do
|
||||
EFFECTIVE_MOD_URL=$(curl -Ls -o /dev/null -w %{url_effective} $i)
|
||||
case "X$EFFECTIVE_MOD_URL" in
|
||||
X[Hh][Tt][Tt][Pp]*.jar)
|
||||
echo "Downloading mod/plugin via HTTP"
|
||||
echo " from $EFFECTIVE_MOD_URL ..."
|
||||
if ! curl -sSL -o /tmp/${EFFECTIVE_MOD_URL##*/} $EFFECTIVE_MOD_URL; then
|
||||
echo "ERROR: failed to download from $EFFECTIVE_MOD_URL to /tmp/${EFFECTIVE_MOD_URL##*/}"
|
||||
exit 2
|
||||
fi
|
||||
|
||||
if [ "$TYPE" = "SPIGOT" ]; then
|
||||
mkdir -p /data/plugins
|
||||
mv /tmp/${EFFECTIVE_MOD_URL##*/} /data/plugins/${EFFECTIVE_MOD_URL##*/}
|
||||
else
|
||||
mkdir -p /data/mods
|
||||
mv /tmp/${EFFECTIVE_MOD_URL##*/} /data/mods/${EFFECTIVE_MOD_URL##*/}
|
||||
fi
|
||||
rm -f /tmp/${EFFECTIVE_MOD_URL##*/}
|
||||
;;
|
||||
*)
|
||||
echo "Invalid URL given for modpack: Must be HTTP or HTTPS and a JAR file"
|
||||
;;
|
||||
esac
|
||||
done
|
||||
fi
|
||||
|
||||
if [[ "$MANIFEST" ]]; then
|
||||
EFFECTIVE_MANIFEST_URL=$(curl -Ls -o /dev/null -w %{url_effective} $MANIFEST)
|
||||
case "X$EFFECTIVE_MANIFEST_URL" in
|
||||
X*.json)
|
||||
if [ -f "${EFFECTIVE_MANIFEST_URL}" ]; then
|
||||
MOD_DIR=${FTB_BASE_DIR:-/data}/mods
|
||||
if [ ! -d "$MOD_DIR" ]
|
||||
then
|
||||
echo "Creating mods dir $MOD_DIR"
|
||||
mkdir -p "$MOD_DIR"
|
||||
fi
|
||||
echo "Starting manifest download..."
|
||||
cat "${EFFECTIVE_MANIFEST_URL}" | jq -r '.files[] | (.projectID|tostring) + " " + (.fileID|tostring)'| while read -r p f
|
||||
do
|
||||
if [ ! -f $MOD_DIR/${p}_${f}.jar ]
|
||||
then
|
||||
url="${CURSE_URL_BASE}/${p}/files/${f}/download"
|
||||
echo Downloading curseforge mod $url
|
||||
# Manifest usually doesn't have mod names. Using id should be fine, tho
|
||||
curl -sSL "${url}" -o $MOD_DIR/${p}_${f}.jar
|
||||
fi
|
||||
done
|
||||
else
|
||||
echo "Could not find manifest file, unsufficient privs, or malformed path."
|
||||
fi
|
||||
;;
|
||||
*)
|
||||
echo "Invalid manifest file for modpack. Please make sure it is a .json file."
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
|
||||
exec /start-finalSetup03Modconfig $@
|
||||
|
||||
0
minecraft-server/start-finalSetup03Modconfig
Executable file → Normal file
0
minecraft-server/start-finalSetup03Modconfig
Executable file → Normal file
57
minecraft-server/start-finalSetup04ServerProperties
Executable file → Normal file
57
minecraft-server/start-finalSetup04ServerProperties
Executable file → Normal file
@@ -11,23 +11,13 @@ function setServerProp {
|
||||
var=${var,,} ;;
|
||||
esac
|
||||
echo "Setting ${prop} to '${var}' in ${SERVER_PROPERTIES}"
|
||||
sed -i "/^${prop}\s*=/ c ${prop}=${var}" $SERVER_PROPERTIES
|
||||
sed -i "/^${prop}\s*=/ c ${prop}=${var}" "$SERVER_PROPERTIES"
|
||||
else
|
||||
echo "Skip setting ${prop}"
|
||||
fi
|
||||
}
|
||||
|
||||
# Deploy server.properties file
|
||||
if [ ! -e $SERVER_PROPERTIES ]; then
|
||||
echo "Creating server.properties in ${SERVER_PROPERTIES}"
|
||||
cp /tmp/server.properties $SERVER_PROPERTIES
|
||||
|
||||
if [[ ${TYPE} == "FEED-THE-BEAST" ]]; then
|
||||
export SERVER_PROPERTIES=${FTB_DIR}/server.properties
|
||||
echo "detected FTB, changing properties path to ${SERVER_PROPERTIES}"
|
||||
cp /tmp/server.properties $SERVER_PROPERTIES
|
||||
fi
|
||||
|
||||
function customizeServerProps {
|
||||
if [ -n "$WHITELIST" ]; then
|
||||
echo "Creating whitelist"
|
||||
setServerProp "whitelist" "true"
|
||||
@@ -36,7 +26,7 @@ if [ ! -e $SERVER_PROPERTIES ]; then
|
||||
|
||||
# If not provided, generate a reasonable default message-of-the-day,
|
||||
# which shows up in the server listing in the client
|
||||
if [ -z $MOTD ]; then
|
||||
if [ -z "$MOTD" ]; then
|
||||
# snapshot is the odd case where we have to look at version to identify that label
|
||||
if [[ ${ORIGINAL_TYPE} == "VANILLA" && ${VERSION} == "SNAPSHOT" ]]; then
|
||||
label=SNAPSHOT
|
||||
@@ -50,6 +40,7 @@ if [ ! -e $SERVER_PROPERTIES ]; then
|
||||
MOTD="A ${label} Minecraft Server powered by Docker"
|
||||
fi
|
||||
|
||||
setServerProp "server-name" "$SERVER_NAME"
|
||||
setServerProp "server-port" "$SERVER_PORT"
|
||||
setServerProp "motd" "$MOTD"
|
||||
setServerProp "allow-nether" "$ALLOW_NETHER"
|
||||
@@ -78,22 +69,7 @@ if [ ! -e $SERVER_PROPERTIES ]; then
|
||||
setServerProp "generator-settings" "$GENERATOR_SETTINGS"
|
||||
setServerProp "online-mode" "$ONLINE_MODE"
|
||||
setServerProp "allow-flight" "$ALLOW_FLIGHT"
|
||||
|
||||
if [ -n "$LEVEL_TYPE" ]; then
|
||||
# normalize to uppercase
|
||||
LEVEL_TYPE=$( echo ${LEVEL_TYPE} | tr '[:lower:]' '[:upper:]' )
|
||||
echo "Setting level type to $LEVEL_TYPE"
|
||||
# check for valid values and only then set
|
||||
case $LEVEL_TYPE in
|
||||
DEFAULT|FLAT|LARGEBIOMES|AMPLIFIED|CUSTOMIZED|BIOMESOP|RTG|RWG|BUFFET)
|
||||
setServerProp "level-type" "$LEVEL_TYPE"
|
||||
;;
|
||||
*)
|
||||
echo "Invalid LEVEL_TYPE: $LEVEL_TYPE"
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
setServerProp "level-type" "${LEVEL_TYPE^^}"
|
||||
|
||||
if [ -n "$DIFFICULTY" ]; then
|
||||
case $DIFFICULTY in
|
||||
@@ -142,8 +118,29 @@ if [ ! -e $SERVER_PROPERTIES ]; then
|
||||
esac
|
||||
setServerProp "gamemode" "$MODE"
|
||||
fi
|
||||
}
|
||||
|
||||
# Deploy server.properties file
|
||||
if [[ ${TYPE} == "FEED-THE-BEAST" ]]; then
|
||||
export SERVER_PROPERTIES=${FTB_DIR}/server.properties
|
||||
echo "detected FTB, changing properties path to ${SERVER_PROPERTIES}"
|
||||
fi
|
||||
|
||||
if [ ! -e "$SERVER_PROPERTIES" ]; then
|
||||
echo "Creating server.properties in ${SERVER_PROPERTIES}"
|
||||
cp /tmp/server.properties "$SERVER_PROPERTIES"
|
||||
customizeServerProps
|
||||
elif [ -n "${OVERRIDE_SERVER_PROPERTIES}" ]; then
|
||||
case ${OVERRIDE_SERVER_PROPERTIES^^} in
|
||||
TRUE|1)
|
||||
customizeServerProps
|
||||
;;
|
||||
*)
|
||||
echo "server.properties already created, skipping"
|
||||
;;
|
||||
esac
|
||||
else
|
||||
echo "server.properties already created, skipping"
|
||||
fi
|
||||
|
||||
exec /start-minecraftFinalSetup $@
|
||||
exec /start-finalSetup05EnvVariables $@
|
||||
|
||||
15
minecraft-server/start-finalSetup05EnvVariables
Normal file
15
minecraft-server/start-finalSetup05EnvVariables
Normal file
@@ -0,0 +1,15 @@
|
||||
#!/bin/bash
|
||||
|
||||
if [ "$REPLACE_ENV_VARIABLES" = "TRUE" ]; then
|
||||
echo "Replacing env variables in configs that match the prefix $ENV_VARIABLE_PREFIX..."
|
||||
while IFS='=' read -r name value ; do
|
||||
# check if name of env variable matches the prefix
|
||||
# sanity check environment variables to avoid code injections
|
||||
if [[ "$name" = $ENV_VARIABLE_PREFIX* ]] && [[ $value =~ ^[0-9a-zA-Z_:/=?.+\-]*$ ]] && [[ $name =~ ^[0-9a-zA-Z_\-]*$ ]]; then
|
||||
echo "Replacing $name with $value ..."
|
||||
find /data/ -type f \( -name "*.yml" -or -name "*.yaml" -or -name "*.txt" -or -name "*.cfg" -or -name "*.properties" \) -exec sed -i 's#${'"$name"'}#'"$value"'#g' {} \;
|
||||
fi
|
||||
done < <(env)
|
||||
fi
|
||||
|
||||
exec /start-minecraftFinalSetup $@
|
||||
78
minecraft-server/start-minecraftFinalSetup
Executable file → Normal file
78
minecraft-server/start-minecraftFinalSetup
Executable file → Normal file
@@ -1,5 +1,7 @@
|
||||
#!/bin/bash
|
||||
|
||||
. /start-utils
|
||||
|
||||
if [ -n "$OPS" -a ! -e ops.txt.converted ]; then
|
||||
echo "Setting ops"
|
||||
echo $OPS | awk -v RS=, '{print}' >> ops.txt
|
||||
@@ -24,27 +26,23 @@ if [ -n "$ICON" -a ! -e server-icon.png ]; then
|
||||
fi
|
||||
|
||||
# Make sure files exist and are valid JSON (for pre-1.12 to 1.12 upgrades)
|
||||
if [[ -z "ls *.json" ]]; then
|
||||
echo "Checking JSON files"
|
||||
for j in *.json; do
|
||||
if [[ $(python -c "print open('$j').read().strip()==''") = True ]]; then
|
||||
echo "Fixing JSON $j"
|
||||
echo '[]' > $j
|
||||
fi
|
||||
done
|
||||
else
|
||||
echo "Skipping JSON check. No files present."
|
||||
fi
|
||||
echo "Checking for JSON files."
|
||||
JSON_FILES=$(find . -maxdepth 1 -name '*.json')
|
||||
for j in $JSON_FILES; 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
|
||||
mkdir -p /data/mods
|
||||
for m in /mods/*.{jar,zip}
|
||||
do
|
||||
if [ -f "$m" -a ! -f "/data/mods/$m" ]; then
|
||||
echo Copying mod `basename "$m"`
|
||||
cp "$m" /data/mods
|
||||
fi
|
||||
done
|
||||
if [ -d /mods ]; then
|
||||
echo "Copying any mods over..."
|
||||
rsync -a --out-format="update:%f:Last Modified %M" --prune-empty-dirs --update /mods /data
|
||||
fi
|
||||
|
||||
[ -d /data/config ] || mkdir /data/config
|
||||
for c in /config/*
|
||||
do
|
||||
@@ -54,10 +52,13 @@ do
|
||||
fi
|
||||
done
|
||||
|
||||
mkdir -p /data/plugins
|
||||
if [ "$TYPE" = "SPIGOT" ]; then
|
||||
if [ -d /plugins ]; then
|
||||
echo Copying any Bukkit plugins over
|
||||
cp -r /plugins /data
|
||||
echo "Copying any Bukkit plugins over..."
|
||||
# Copy plugins over using rsync to allow deeply nested updates of plugins
|
||||
# only updates files if the source file is newer and print updated files
|
||||
rsync -a --out-format="update:%f:Last Modified %M" --prune-empty-dirs --update /plugins /data
|
||||
fi
|
||||
fi
|
||||
|
||||
@@ -75,31 +76,54 @@ fi
|
||||
# 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}}"
|
||||
|
||||
expandedDOpts=
|
||||
if [ -n "$JVM_DD_OPTS" ]; then
|
||||
for dopt in $JVM_DD_OPTS
|
||||
do
|
||||
expandedDOpts="${expandedDOpts} -D${dopt/:/=}"
|
||||
done
|
||||
fi
|
||||
|
||||
mcServerRunnerArgs="--stop-duration 60s"
|
||||
|
||||
if [[ ${TYPE} == "FEED-THE-BEAST" ]]; then
|
||||
if [ ! -e ${FTB_DIR}/ops.json -a -e /data/ops.txt ]; then
|
||||
if [ ! -e "${FTB_DIR}/ops.json" -a -e /data/ops.txt ]; then
|
||||
cp -f /data/ops.txt ${FTB_DIR}/
|
||||
fi
|
||||
|
||||
if [ ! -e ${FTB_DIR}/whitelist.json -a -e /data/white-list.txt ]; then
|
||||
if [ ! -e "${FTB_DIR}/whitelist.json" -a -e /data/white-list.txt ]; then
|
||||
cp -f /data/white-list.txt ${FTB_DIR}/
|
||||
fi
|
||||
|
||||
cp -f /data/eula.txt ${FTB_DIR}/
|
||||
cp -f /data/eula.txt "${FTB_DIR}/"
|
||||
|
||||
cat > ${FTB_DIR}/settings-local.sh <<EOF
|
||||
cat > "${FTB_DIR}/settings-local.sh" <<EOF
|
||||
export MIN_RAM="${INIT_MEMORY}"
|
||||
export MAX_RAM="${MAX_MEMORY}"
|
||||
export JAVA_PARAMETERS="-Xms${INIT_MEMORY} $expandedDOpts"
|
||||
EOF
|
||||
|
||||
cd ${FTB_DIR}
|
||||
# patch CurseForge cfg file, if present
|
||||
if [ -f "${FTB_DIR}/settings.cfg" ]; then
|
||||
sed -i "/MAX_RAM=.*/ c MAX_RAM=${MAX_MEMORY};" "${FTB_DIR}/settings.cfg"
|
||||
fi
|
||||
|
||||
cd "${FTB_DIR}"
|
||||
echo "Running FTB ${FTB_SERVER_START} in ${FTB_DIR} ..."
|
||||
exec mc-server-runner ${FTB_SERVER_START}
|
||||
if isTrue ${DEBUG_EXEC}; then
|
||||
set -x
|
||||
fi
|
||||
exec mc-server-runner ${mcServerRunnerArgs} "${FTB_SERVER_START}"
|
||||
else
|
||||
# If we have a bootstrap.txt file... feed that in to the server stdin
|
||||
if [ -f /data/bootstrap.txt ]; then
|
||||
bootstrapArgs="--bootstrap /data/bootstrap.txt"
|
||||
fi
|
||||
|
||||
echo "Starting the Minecraft server..."
|
||||
JVM_OPTS="-Xms${INIT_MEMORY} -Xmx${MAX_MEMORY} ${JVM_OPTS}"
|
||||
exec mc-server-runner ${bootstrapArgs} java $JVM_XX_OPTS $JVM_OPTS -jar $SERVER "$@" $EXTRA_ARGS
|
||||
if isTrue ${DEBUG_EXEC}; then
|
||||
set -x
|
||||
fi
|
||||
exec mc-server-runner ${bootstrapArgs} ${mcServerRunnerArgs} java $JVM_XX_OPTS $JVM_OPTS $expandedDOpts -jar $SERVER "$@" $EXTRA_ARGS
|
||||
fi
|
||||
|
||||
@@ -25,4 +25,18 @@ function isTrue {
|
||||
esac
|
||||
|
||||
return ${result}
|
||||
}
|
||||
|
||||
function isDebugging {
|
||||
if [[ ${DEBUG^^} = TRUE ]]; then
|
||||
return 0
|
||||
else
|
||||
return 1
|
||||
fi
|
||||
}
|
||||
|
||||
function debug {
|
||||
if isDebugging; then
|
||||
echo "DEBUG: $*"
|
||||
fi
|
||||
}
|
||||
@@ -1,16 +0,0 @@
|
||||
FROM itzg/gvm
|
||||
|
||||
LABEL maintainer "itzg"
|
||||
|
||||
RUN ["/run", "install", "springboot"]
|
||||
|
||||
ADD run /run
|
||||
ENTRYPOINT ["/run"]
|
||||
|
||||
VOLUME ["/home/spring"]
|
||||
ADD app.groovy /home/spring/app.groovy
|
||||
EXPOSE 8080
|
||||
|
||||
WORKDIR /home/spring
|
||||
|
||||
CMD ["run", "app.groovy"]
|
||||
@@ -1,9 +0,0 @@
|
||||
@RestController
|
||||
class ThisWillActuallyRun {
|
||||
|
||||
@RequestMapping("/")
|
||||
String home() {
|
||||
"Hello World!"
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,5 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
. /.gvm/bin/gvm-init.sh
|
||||
|
||||
spring $*
|
||||
0
titan-gremlin/Dockerfile
Executable file → Normal file
0
titan-gremlin/Dockerfile
Executable file → Normal file
0
titan-gremlin/start-gremlin.sh
Executable file → Normal file
0
titan-gremlin/start-gremlin.sh
Executable file → Normal file
0
titandb/gremlin
Executable file → Normal file
0
titandb/gremlin
Executable file → Normal file
0
titandb/rexster
Executable file → Normal file
0
titandb/rexster
Executable file → Normal file
0
ubuntu-openjdk-7/Dockerfile
Executable file → Normal file
0
ubuntu-openjdk-7/Dockerfile
Executable file → Normal file
Reference in New Issue
Block a user