mirror of
https://github.com/itzg/docker-minecraft-server.git
synced 2026-02-17 07:03:57 +00:00
Compare commits
201 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5c6a2cf44f | ||
|
|
536a7f6095 | ||
|
|
df9e725baf | ||
|
|
156716a7d8 | ||
|
|
0876ef7704 | ||
|
|
5c3ea25ff3 | ||
|
|
bd8e0cf5d2 | ||
|
|
1d5c4e3b0b | ||
|
|
6a565692a0 | ||
|
|
cf68446a00 | ||
|
|
c4a92f6706 | ||
|
|
7bb397a031 | ||
|
|
d86f034e96 | ||
|
|
20385507d8 | ||
|
|
91def1176d | ||
|
|
2e03ee4197 | ||
|
|
e8dd60a831 | ||
|
|
dc15094b8a | ||
|
|
fc807429e4 | ||
|
|
5ec21fc0ba | ||
|
|
3a0a8a9ced | ||
|
|
b9b05dbdfc | ||
|
|
179e72cda0 | ||
|
|
2b9514ab0b | ||
|
|
8a04a9f72e | ||
|
|
3a7af8e8d6 | ||
|
|
615d12bce3 | ||
|
|
72d055ac19 | ||
|
|
80c18004c1 | ||
|
|
97e9b2901c | ||
|
|
027d94cc77 | ||
|
|
66261af03d | ||
|
|
290e2c734a | ||
|
|
54d19715c7 | ||
|
|
bbe1533f91 | ||
|
|
97040f61ed | ||
|
|
55801ac11c | ||
|
|
07c32d8ee4 | ||
|
|
2e631bcbd9 | ||
|
|
c96c630fe5 | ||
|
|
f69e75cfc1 | ||
|
|
6157a693f1 | ||
|
|
854a158d3d | ||
|
|
18919ef33c | ||
|
|
32b0737e70 | ||
|
|
79eb164e90 | ||
|
|
e3296c3cc0 | ||
|
|
f5dbbcc2c6 | ||
|
|
134eaedf23 | ||
|
|
4a89f3c579 | ||
|
|
17420ed590 | ||
|
|
2125fa0855 | ||
|
|
5c14c30a78 | ||
|
|
788d06c086 | ||
|
|
1a88c96beb | ||
|
|
b8d69278e4 | ||
|
|
4a7ecffcbb | ||
|
|
9fe0021a7a | ||
|
|
262816bd2d | ||
|
|
e44d27c00a | ||
|
|
5062bc91ab | ||
|
|
dde4132d2c | ||
|
|
9bb3628792 | ||
|
|
03a5bb1ab0 | ||
|
|
3a9a1dc043 | ||
|
|
36ced1c630 | ||
|
|
2d8b3d7275 | ||
|
|
f48eedee78 | ||
|
|
08d459c373 | ||
|
|
0cb0755739 | ||
|
|
3e8eca6e28 | ||
|
|
a179f5f7ba | ||
|
|
f2955bcc2f | ||
|
|
a0c1ed88d1 | ||
|
|
de6d7a64ac | ||
|
|
3bf560bfbe | ||
|
|
f1b58323d3 | ||
|
|
d4a888073b | ||
|
|
54844930bb | ||
|
|
b26714c9c1 | ||
|
|
f03a8f0edc | ||
|
|
048beefadc | ||
|
|
de3545e8d9 | ||
|
|
e766301d1e | ||
|
|
3348083424 | ||
|
|
1e0183a3b1 | ||
|
|
fd0500feb2 | ||
|
|
e86138cdf2 | ||
|
|
ddb69ced3b | ||
|
|
c48f85cc4f | ||
|
|
aa13deecdb | ||
|
|
4c0f24613c | ||
|
|
b5bcea7d61 | ||
|
|
76d4fd1bbc | ||
|
|
f7523eef4e | ||
|
|
c38bfb22cc | ||
|
|
8cea619c13 | ||
|
|
e570ac8715 | ||
|
|
d14d666e24 | ||
|
|
8956d43c47 | ||
|
|
911fcf8b42 | ||
|
|
3e61c8084f | ||
|
|
fe6e8c04ff | ||
|
|
f1293ff979 | ||
|
|
5c5b8cd999 | ||
|
|
074424a5bd | ||
|
|
99b1de0bbd | ||
|
|
47c3350c10 | ||
|
|
84bb96ef38 | ||
|
|
ada4a1fab5 | ||
|
|
ea78bdd559 | ||
|
|
fa790ab787 | ||
|
|
281c044999 | ||
|
|
b9dcdee34b | ||
|
|
87b2ce1c24 | ||
|
|
55e38181bd | ||
|
|
ac3cbe75a9 | ||
|
|
d89de80db8 | ||
|
|
1e1a572227 | ||
|
|
379905c6ff | ||
|
|
ec1dd96a7c | ||
|
|
413de37568 | ||
|
|
3147c5638f | ||
|
|
0832bb0c43 | ||
|
|
b97348d703 | ||
|
|
4cff161deb | ||
|
|
b1c0e598ad | ||
|
|
63035c347b | ||
|
|
c806c425fd | ||
|
|
0defd266a6 | ||
|
|
dd5a21067b | ||
|
|
2d48bcb1a0 | ||
|
|
5617936f10 | ||
|
|
b5e459ab0a | ||
|
|
ae9109e2bf | ||
|
|
b9f247728f | ||
|
|
3052cd1155 | ||
|
|
46c865a123 | ||
|
|
cf5d194b14 | ||
|
|
0ea4ea7d0c | ||
|
|
a6580b3fe3 | ||
|
|
a4835ec331 | ||
|
|
21c9be4ec1 | ||
|
|
786192e4b7 | ||
|
|
8610e7d621 | ||
|
|
a195583990 | ||
|
|
a1ead0634e | ||
|
|
b23fb93366 | ||
|
|
68d731c096 | ||
|
|
a4bd241be6 | ||
|
|
5f104a32db | ||
|
|
03d9064b35 | ||
|
|
b15ad9e799 | ||
|
|
17bfedd137 | ||
|
|
afa25e582d | ||
|
|
7651cc658e | ||
|
|
dd0bcda23c | ||
|
|
afa710455d | ||
|
|
70a55e3be1 | ||
|
|
13ee106dac | ||
|
|
6253d5ddc0 | ||
|
|
63e3123ab0 | ||
|
|
1be18346ce | ||
|
|
9a90acab23 | ||
|
|
edd69c40f6 | ||
|
|
582c60cd03 | ||
|
|
13a6d91295 | ||
|
|
d0263f31d6 | ||
|
|
4ab31a049b | ||
|
|
4b74d13f08 | ||
|
|
2afbdc959e | ||
|
|
9fa27b9a3d | ||
|
|
16b3f18400 | ||
|
|
79f9e02446 | ||
|
|
a313c03fff | ||
|
|
e76068e63e | ||
|
|
2427cae5a2 | ||
|
|
e902c6f40f | ||
|
|
ef34025dd8 | ||
|
|
0acedd04b9 | ||
|
|
2f5402195c | ||
|
|
764ae807e0 | ||
|
|
32cb5f44e4 | ||
|
|
a6e32f0ea9 | ||
|
|
111883e0d5 | ||
|
|
847f403bd3 | ||
|
|
39bb0d75e2 | ||
|
|
01473c4e43 | ||
|
|
b3a79d6b08 | ||
|
|
5484f50659 | ||
|
|
53e727298e | ||
|
|
a4aa177d6e | ||
|
|
a412cfddad | ||
|
|
594c9873c4 | ||
|
|
94442458e3 | ||
|
|
f75d735540 | ||
|
|
fec75cb117 | ||
|
|
007fca149c | ||
|
|
ac608b7abb | ||
|
|
7f048c5e8b | ||
|
|
53932e64f2 |
17
.gitattributes
vendored
Normal file
17
.gitattributes
vendored
Normal file
@@ -0,0 +1,17 @@
|
||||
# Auto detect text files and perform LF normalization
|
||||
* text=auto
|
||||
|
||||
# Custom for Visual Studio
|
||||
*.cs diff=csharp
|
||||
|
||||
# Standard to msysgit
|
||||
*.doc diff=astextplain
|
||||
*.DOC diff=astextplain
|
||||
*.docx diff=astextplain
|
||||
*.DOCX diff=astextplain
|
||||
*.dot diff=astextplain
|
||||
*.DOT diff=astextplain
|
||||
*.pdf diff=astextplain
|
||||
*.PDF diff=astextplain
|
||||
*.rtf diff=astextplain
|
||||
*.RTF diff=astextplain
|
||||
3
.gitignore
vendored
3
.gitignore
vendored
@@ -1 +1,2 @@
|
||||
.idea/
|
||||
*.iml
|
||||
.idea
|
||||
|
||||
10
README.md
10
README.md
@@ -1,6 +1,10 @@
|
||||
dockerfiles
|
||||
===========
|
||||
|
||||
Contains the various Dockerfile definitions I'm maintaining.
|
||||
This repository contains the various Dockerfile definitions I'm maintaining.
|
||||
|
||||
[](https://gitter.im/itzg/dockerfiles?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge)
|
||||
|
||||
### Discontinued
|
||||
|
||||
##### Cassandra
|
||||
|
||||
I have found the [official image](https://hub.docker.com/_/cassandra/) to be quite sufficient
|
||||
|
||||
2
build
2
build
@@ -5,10 +5,8 @@ pkgs="$pkgs minecraft-server"
|
||||
pkgs="$pkgs elasticsearch"
|
||||
pkgs="$pkgs kibana"
|
||||
pkgs="$pkgs titan-gremlin"
|
||||
pkgs="$pkgs cassandra"
|
||||
|
||||
for p in $pkgs
|
||||
do
|
||||
docker build -t itzg/$p $p
|
||||
done
|
||||
|
||||
|
||||
@@ -1,26 +0,0 @@
|
||||
FROM itzg/ubuntu-openjdk-7
|
||||
|
||||
MAINTAINER itzg
|
||||
|
||||
ENV CASSANDRA_VERSION 2.1.8
|
||||
|
||||
RUN wget -qO /tmp/apache-cassandra.tgz http://mirrors.ibiblio.org/apache/cassandra/$CASSANDRA_VERSION/apache-cassandra-$CASSANDRA_VERSION-bin.tar.gz
|
||||
RUN tar -C /opt -zxvf /tmp/apache-cassandra.tgz && \
|
||||
rm /tmp/apache-cassandra.tgz
|
||||
|
||||
|
||||
RUN mv /opt/apache-cassandra-$CASSANDRA_VERSION /opt/cassandra
|
||||
ENV CASSANDRA_HOME /opt/cassandra
|
||||
ENV CASSANDRA_CONF /conf
|
||||
ENV CASSANDRA_DATA /data
|
||||
WORKDIR $CASSANDRA_HOME
|
||||
|
||||
RUN ln -s $CASSANDRA_HOME/bin/* /usr/local/bin
|
||||
VOLUME ["/data","/conf"]
|
||||
|
||||
EXPOSE 9042 9160 7000 7001
|
||||
|
||||
ADD cassandra.in.sh $CASSANDRA_HOME/cassandra.in.sh
|
||||
RUN mv $CASSANDRA_HOME/bin/cassandra.in.sh $CASSANDRA_HOME/bin/orig.cassandra.in.sh
|
||||
|
||||
CMD ["/opt/cassandra/bin/cassandra", "-f"]
|
||||
@@ -1,9 +0,0 @@
|
||||
Yet another Cassandra image, but this one got container and non-container access right.
|
||||
|
||||
# Basic Usage
|
||||
|
||||
To support access from both Docker containers and external, non-Docker clients:
|
||||
|
||||
docker run -d --name cassandra -e PUBLISH_AS=192.168.59.103 -p 9160:9160 itzg/cassandra
|
||||
|
||||
replacing `192.168.59.103` with your Docker host's LAN IP address.
|
||||
@@ -1,27 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
sed -i -e 's/log4j.rootLogger=.*/log4j.rootLogger=INFO,stdout/' $CASSANDRA_HOME/conf/log4j-server.properties
|
||||
|
||||
cassYml=$CASSANDRA_HOME/conf/cassandra.yaml
|
||||
|
||||
privateAddr=$(hostname -i)
|
||||
|
||||
seeds=${SEEDS:-${PUBLISH_AS:-$privateAddr}}
|
||||
|
||||
sed -i -e "s/- seeds:.*/- seeds: \"$seeds\"/" $cassYml
|
||||
|
||||
sed -i -e "s/listen_address:.*/listen_address: $privateAddr/" $cassYml
|
||||
sed -i -e "s/rpc_address:.*/rpc_address: $privateAddr/" $cassYml
|
||||
|
||||
sed -i -e "s#- /var/lib/cassandra/data#- $CASSANDRA_DATA#" $cassYml
|
||||
|
||||
if [ -n "$PUBLISH_AS" ]; then
|
||||
sed -i -e "s/\(\s*#\)\?\s*broadcast_address:.*/broadcast_address: $PUBLISH_AS/" $cassYml
|
||||
fi
|
||||
|
||||
# Copy over our tweaked files, but non-clobbering to let user have ultimate control
|
||||
cp -rn $CASSANDRA_HOME/conf/* $CASSANDRA_CONF
|
||||
|
||||
# source the original
|
||||
. $CASSANDRA_HOME/bin/orig.cassandra.in.sh
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
FROM itzg/ubuntu-openjdk-7
|
||||
|
||||
RUN apt-get update
|
||||
RUN apt-get install -yq git curl wget unzip openjdk-7-jdk
|
||||
RUN DEBIAN_FRONTEND=noninteractive \
|
||||
apt-get install -yq git curl wget unzip openjdk-7-jdk && \
|
||||
apt-get clean
|
||||
|
||||
ENV MAVEN_VER 3.2.2
|
||||
ENV NODEJS_VER 0.10.29
|
||||
|
||||
WORKDIR /opt
|
||||
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
|
||||
@@ -17,13 +17,14 @@ RUN curl -s https://raw.githubusercontent.com/isaacs/nave/master/nave.sh > /usr/
|
||||
RUN chmod +x /usr/local/bin/nave
|
||||
RUN nave usemain latest
|
||||
|
||||
WORKDIR /root
|
||||
env HOME /root
|
||||
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
|
||||
|
||||
RUN apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
|
||||
|
||||
WORKDIR /home/developer
|
||||
CMD bash
|
||||
|
||||
40
elasticsearch/Dockerfile
Normal file → Executable file
40
elasticsearch/Dockerfile
Normal file → Executable file
@@ -1,26 +1,32 @@
|
||||
FROM itzg/ubuntu-openjdk-7
|
||||
FROM openjdk:8u121-jre-alpine
|
||||
|
||||
MAINTAINER itzg
|
||||
LABEL maintainer "itzg"
|
||||
|
||||
ENV ES_VERSION 1.6.0
|
||||
RUN apk -U add bash
|
||||
|
||||
RUN wget -qO /tmp/es.tgz https://download.elasticsearch.org/elasticsearch/elasticsearch/elasticsearch-$ES_VERSION.tar.gz && \
|
||||
cd /usr/share && \
|
||||
ENV ES_VERSION=5.4.0
|
||||
|
||||
ADD https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-$ES_VERSION.tar.gz /tmp/es.tgz
|
||||
RUN cd /usr/share && \
|
||||
tar xf /tmp/es.tgz && \
|
||||
rm /tmp/es.tgz
|
||||
|
||||
ENV ES_HOME /usr/share/elasticsearch-$ES_VERSION
|
||||
RUN useradd -d $ES_HOME -M -r elasticsearch && \
|
||||
chown -R elasticsearch: $ES_HOME
|
||||
|
||||
RUN mkdir /data /conf && touch /data/.CREATED /conf/.CREATED && chown -R elasticsearch: /data /conf
|
||||
VOLUME ["/data","/conf"]
|
||||
|
||||
ADD start /start
|
||||
|
||||
WORKDIR $ES_HOME
|
||||
USER elasticsearch
|
||||
|
||||
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 \
|
||||
ES_JAVA_OPTS="-Xms1g -Xmx1g"
|
||||
|
||||
RUN adduser -S -s /bin/sh $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"]
|
||||
|
||||
213
elasticsearch/README.md
Normal file → Executable file
213
elasticsearch/README.md
Normal file → Executable file
@@ -1,17 +1,17 @@
|
||||
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.
|
||||
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:
|
||||
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:
|
||||
You'll then be able to connect to the Elasticsearch HTTP interface to confirm it's alive:
|
||||
|
||||
http://DOCKERHOST:9200/
|
||||
|
||||
@@ -28,24 +28,18 @@ http://DOCKERHOST:9200/
|
||||
"tagline" : "You Know, for Search"
|
||||
}
|
||||
|
||||
Where `DOCKERHOST` would be the actual hostname of your host running
|
||||
Docker.
|
||||
Where `DOCKERHOST` would be the actual hostname of your host running Docker.
|
||||
|
||||
# Basic multi-node cluster
|
||||
# Simple, multi-node cluster
|
||||
|
||||
Running a multi-node cluster (3-node in this example) is almost as easy:
|
||||
To run a multi-node cluster (3-node in this example) on a single Docker machine use:
|
||||
|
||||
docker run -d -p 9200:9200 -p 9300:9300 itzg/elasticsearch
|
||||
docker run -d -p 9201:9200 -p 9301:9300 itzg/elasticsearch
|
||||
docker run -d -p 9202:9200 -p 9302:9300 itzg/elasticsearch
|
||||
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
|
||||
|
||||
where the only difference was the host port binding of `9200:`/`9300:`,
|
||||
`9201:`/`9301:`, and `9202:`/`9302:`. By default, Elasticsearch uses
|
||||
[Zen Discovery](http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/modules-discovery-zen.html), so the three nodes find each other and form a cluster. You
|
||||
can confirm that by checking the cluster health for the presence of
|
||||
three nodes (`number_of_nodes`):
|
||||
|
||||
http://DOCKERHOST:9200/_cluster/health?pretty
|
||||
and then check the cluster health, such as http://192.168.99.100:9200/_cluster/health?pretty
|
||||
|
||||
{
|
||||
"cluster_name" : "elasticsearch",
|
||||
@@ -60,26 +54,86 @@ http://DOCKERHOST:9200/_cluster/health?pretty
|
||||
"unassigned_shards" : 0
|
||||
}
|
||||
|
||||
# Configuration
|
||||
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:
|
||||
|
||||
The following configuration options are specified using `docker run`
|
||||
environment variables (`-e`) like
|
||||
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":
|
||||
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:
|
||||
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]
|
||||
|
||||
@@ -89,8 +143,7 @@ such as
|
||||
|
||||
## Plugins
|
||||
|
||||
You can install one or more plugins before startup by passing a comma-separated
|
||||
list of plugins.
|
||||
You can install one or more plugins before startup by passing a comma-separated list of plugins.
|
||||
|
||||
-e PLUGINS=ID[,ID]
|
||||
|
||||
@@ -102,10 +155,7 @@ Many more plugins [are available here](http://www.elasticsearch.org/guide/en/ela
|
||||
|
||||
## 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:
|
||||
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
|
||||
|
||||
@@ -114,7 +164,94 @@ than the cosmetic weirdness in the logs, Elasticsearch seems to be quite toleran
|
||||
|
||||
## Node Name
|
||||
|
||||
Rather than use the randomly assigned node name, you can indicate a specific
|
||||
one using:
|
||||
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.
|
||||
* `GATEWAY` (or `COORDINATING`) : only operates as a client node or a "smart router". These are the ones whose HTTP port 9200 will need to be exposed
|
||||
* `INGEST` : operates only as an ingest node and is not master or data eligble
|
||||
|
||||
A [Docker Compose](https://docs.docker.com/compose/overview/) file will serve as a good example of these three node types:
|
||||
|
||||
```
|
||||
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.
|
||||
|
||||
44
elasticsearch/docker-compose-localbuild.yml
Normal file
44
elasticsearch/docker-compose-localbuild.yml
Normal file
@@ -0,0 +1,44 @@
|
||||
version: '3'
|
||||
|
||||
services:
|
||||
master:
|
||||
build: .
|
||||
environment:
|
||||
TYPE: MASTER
|
||||
UNICAST_HOSTS: master
|
||||
MIN_MASTERS: 1
|
||||
deploy:
|
||||
replicas: 1
|
||||
update_config:
|
||||
parallelism: 1
|
||||
data:
|
||||
build: .
|
||||
environment:
|
||||
TYPE: DATA
|
||||
UNICAST_HOSTS: master
|
||||
deploy:
|
||||
replicas: 2
|
||||
update_config:
|
||||
parallelism: 1
|
||||
delay: 60s
|
||||
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
|
||||
ports:
|
||||
- "5601:5601"
|
||||
environment:
|
||||
ELASTICSEARCH_URL: http://gateway:9200
|
||||
44
elasticsearch/docker-compose.yml
Normal file
44
elasticsearch/docker-compose.yml
Normal file
@@ -0,0 +1,44 @@
|
||||
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
|
||||
6
elasticsearch/java.policy
Normal file
6
elasticsearch/java.policy
Normal file
@@ -0,0 +1,6 @@
|
||||
grant {
|
||||
// JMX Java Management eXtensions
|
||||
permission javax.management.MBeanTrustPermission "register";
|
||||
permission javax.management.MBeanServerPermission "createMBeanServer";
|
||||
permission javax.management.MBeanPermission "-#-[-]", "queryNames";
|
||||
};
|
||||
74
elasticsearch/log4j2.properties
Normal file
74
elasticsearch/log4j2.properties
Normal file
@@ -0,0 +1,74 @@
|
||||
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,43 +1,157 @@
|
||||
#!/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|NON_MASTER)
|
||||
OPTS="$OPTS -E node.master=false -E node.data=true -E node.ingest=false"
|
||||
;;
|
||||
|
||||
*)
|
||||
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/logging.* ]; then
|
||||
cp $ES_HOME/config/logging.yml /conf
|
||||
if [ ! -e /conf/log4j2.properties ]; then
|
||||
cp $ES_HOME/config/log4j2.properties /conf
|
||||
fi
|
||||
|
||||
OPTS="-Des.path.conf=/conf \
|
||||
-Des.path.data=/data \
|
||||
-Des.path.logs=/data \
|
||||
-Des.transport.tcp.port=9300 \
|
||||
-Des.http.port=9200"
|
||||
OPTS="$OPTS \
|
||||
-E path.conf=/conf \
|
||||
-E path.data=/data \
|
||||
-E path.logs=/data \
|
||||
-E transport.tcp.port=9300 \
|
||||
-E http.port=9200"
|
||||
|
||||
if [ -n "$CLUSTER" ]; then
|
||||
OPTS="$OPTS -Des.cluster.name=$CLUSTER"
|
||||
discoverAllGlobalIps
|
||||
if [ "${DISCOVER_TRANSPORT_IP}" != "" ]; then
|
||||
discoverIpFromLink $DISCOVER_TRANSPORT_IP transport
|
||||
fi
|
||||
if [ "${DISCOVER_HTTP_IP}" != "" ]; then
|
||||
discoverIpFromLink $DISCOVER_HTTP_IP http
|
||||
fi
|
||||
|
||||
if [ -n "$NODE_NAME" ]; then
|
||||
OPTS="$OPTS -Des.node.name=$NODE_NAME"
|
||||
fi
|
||||
setup_personality
|
||||
setup_clustering
|
||||
install_plugins
|
||||
|
||||
if [ -n "$UNICAST_HOSTS" ]; then
|
||||
OPTS="$OPTS -Des.discovery.zen.ping.unicast.hosts=$UNICAST_HOSTS"
|
||||
fi
|
||||
|
||||
if [ -n "$PUBLISH_AS" ]; then
|
||||
OPTS="$OPTS -Des.transport.publish_host=$(echo $PUBLISH_AS | awk -F: '{print $1}')"
|
||||
OPTS="$OPTS -Des.transport.publish_port=$(echo $PUBLISH_AS | awk -F: '{if ($2) print $2; else print 9300}')"
|
||||
fi
|
||||
|
||||
if [ -n "$PLUGINS" ]; then
|
||||
for p in $(echo $PLUGINS | awk -v RS=, '{print}')
|
||||
do
|
||||
echo "Installing the plugin $p"
|
||||
$ES_HOME/bin/plugin --install $p
|
||||
done
|
||||
fi
|
||||
mkdir -p /conf/scripts
|
||||
|
||||
echo "Starting Elasticsearch with the options $OPTS"
|
||||
$ES_HOME/bin/elasticsearch $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
|
||||
|
||||
@@ -1,30 +1,26 @@
|
||||
FROM itzg/ubuntu-openjdk-7
|
||||
|
||||
MAINTAINER itzg
|
||||
FROM java:8
|
||||
|
||||
LABEL maintainer "itzg"
|
||||
|
||||
ENV GITBLIT_VERSION 1.7.1
|
||||
|
||||
RUN wget -qO /tmp/gitblit.tgz http://dl.bintray.com/gitblit/releases/gitblit-$GITBLIT_VERSION.tar.gz
|
||||
|
||||
RUN tar -C /opt -xvf /tmp/gitblit.tgz && \
|
||||
rm /tmp/gitblit.tgz
|
||||
|
||||
ENV APT_GET_UPDATE 2014-07-19
|
||||
|
||||
RUN apt-get update
|
||||
RUN apt-get -y install wget tar
|
||||
|
||||
ENV GITBLIT_VERSION 1.6.0
|
||||
|
||||
RUN wget -O /tmp/gitblit.tgz http://dl.bintray.com/gitblit/releases/gitblit-$GITBLIT_VERSION.tar.gz
|
||||
|
||||
RUN mkdir /opt/gitblit
|
||||
RUN tar -C /opt/gitblit -xvf /tmp/gitblit.tgz
|
||||
RUN rm /tmp/gitblit.tgz
|
||||
|
||||
VOLUME ["/data"]
|
||||
|
||||
|
||||
ADD start.sh /start
|
||||
|
||||
WORKDIR /opt/gitblit
|
||||
ENV GITBLIT_PATH /opt/gitblit
|
||||
ENV GITBLIT_HTTPS_PORT 443
|
||||
ENV GITBLIT_HTTP_PORT 80
|
||||
ENV GITBLIT_BASE_FOLDER /data
|
||||
|
||||
|
||||
ENV GITBLIT_PATH=/opt/gitblit-${GITBLIT_VERSION} \
|
||||
GITBLIT_HTTPS_PORT=443 \
|
||||
GITBLIT_HTTP_PORT=80 \
|
||||
GITBLIT_BASE_FOLDER=/data \
|
||||
GITBLIT_ADMIN_USER=admin \
|
||||
GITBLIT_INITIAL_REPO=
|
||||
WORKDIR $GITBLIT_PATH
|
||||
|
||||
EXPOSE 80 443
|
||||
|
||||
CMD ["/start"]
|
||||
|
||||
ENTRYPOINT ["/start"]
|
||||
|
||||
@@ -1,5 +1,46 @@
|
||||
Provides a ready-to-use instance of [GitBlit](http://gitblit.com/). In order to allow for
|
||||
future upgrades run the container with a volume mount of `/data`, such as:
|
||||
Provides a ready-to-use instance of [GitBlit](http://gitblit.com/).
|
||||
|
||||
docker run -d -p 80:80 p 443:443 -v /tmp/gitblit-data:/data --name gitblit itzg/gitblit
|
||||
## Basic usage
|
||||
|
||||
Start the GitBlit container using
|
||||
|
||||
docker run -d -p 80:80 -p 443:443 --name gitblit itzg/gitblit
|
||||
|
||||
Access its web interface at the mapped HTTP (80) or HTTPS (443) port of the
|
||||
Docker host. Login with the default credentials __admin__ / __admin__ .
|
||||
|
||||
|
||||
## Data volume
|
||||
|
||||
In order to allow for future upgrades, run the container with a volume mount of `/data`, such as:
|
||||
|
||||
-v /tmp/gitblit-data:/data
|
||||
|
||||
## Initial repository creation
|
||||
|
||||
As a convenience for cluster configuration management with git
|
||||
(such as with [Spring Cloud Config](https://cloud.spring.io/spring-cloud-config/)),
|
||||
you may specify the name of an initial repository to be owned by the 'admin' user.
|
||||
This can be enabled by passing the name of that repository via the environment
|
||||
variable `GITBLIT_INITIAL_REPO`, such as
|
||||
|
||||
-e GITBLIT_INITIAL_REPO=default
|
||||
|
||||
## Create repositories with content
|
||||
|
||||
In addition to the approach above, you can push repostories with existing
|
||||
content by attaching them to sub-directories of `/repos`, such as
|
||||
|
||||
docker run -v $HOME/git/example:/repos/example ...
|
||||
|
||||
## Custom configuration
|
||||
|
||||
You can add or override any of the `*.properties` files for configuring GitBlit,
|
||||
typically `gitblit.properties`, by placing those files in a volume attached at
|
||||
`/config`, such as
|
||||
|
||||
-v $(pwd)/extra-config:/config
|
||||
|
||||
The property files in that configuration directory will be renamed with the
|
||||
suffix `.applied` to avoid overwriting manually modified configuration on
|
||||
the next container startup.
|
||||
|
||||
103
gitblit/start.sh
103
gitblit/start.sh
@@ -1,10 +1,103 @@
|
||||
#!/bin/sh
|
||||
#!/bin/bash
|
||||
|
||||
contents=`ls $GITBLIT_BASE_FOLDER|wc -l`
|
||||
apply_base_data() {
|
||||
contents=`ls $GITBLIT_BASE_FOLDER|wc -l`
|
||||
|
||||
if [ $contents = "0" ]; then
|
||||
cp -r $GITBLIT_PATH/data/* $GITBLIT_BASE_FOLDER
|
||||
if [ $contents = "0" ]; then
|
||||
cp -r $GITBLIT_PATH/data/* $GITBLIT_BASE_FOLDER
|
||||
fi
|
||||
}
|
||||
|
||||
apply_config() {
|
||||
cp -rf /config/* $GITBLIT_BASE_FOLDER
|
||||
}
|
||||
|
||||
create_repo() {
|
||||
local repo_dir=$GITBLIT_BASE_FOLDER/git/$1.git
|
||||
mkdir -p $repo_dir
|
||||
cd $repo_dir
|
||||
|
||||
git init --bare
|
||||
|
||||
echo "
|
||||
[gitblit]
|
||||
description =
|
||||
originRepository =
|
||||
owner = $GITBLIT_ADMIN_USER
|
||||
acceptNewPatchsets = true
|
||||
acceptNewTickets = true
|
||||
mergeTo = master
|
||||
useIncrementalPushTags = false
|
||||
allowForks = true
|
||||
accessRestriction = PUSH
|
||||
authorizationControl = AUTHENTICATED
|
||||
verifyCommitter = false
|
||||
showRemoteBranches = false
|
||||
isFrozen = false
|
||||
skipSizeCalculation = false
|
||||
skipSummaryMetrics = false
|
||||
federationStrategy = FEDERATE_THIS
|
||||
isFederated = false
|
||||
gcThreshold =
|
||||
gcPeriod = 0
|
||||
" >> config
|
||||
|
||||
git config --replace-all core.logallrefupdates false
|
||||
|
||||
echo "
|
||||
CREATING repository '$1' with:
|
||||
* read/clone access for all
|
||||
* push access for authenticated users"
|
||||
|
||||
RET="file://$repo_dir"
|
||||
}
|
||||
|
||||
apply_repos() {
|
||||
for rdir in /repos/*; do
|
||||
if [ -e $rdir/.git ]; then
|
||||
r=$(basename $rdir)
|
||||
create_repo $r
|
||||
local url=$RET
|
||||
cd $rdir
|
||||
echo "* pushed existing content"
|
||||
git push --all $url
|
||||
fi
|
||||
|
||||
done
|
||||
}
|
||||
|
||||
create_initial_repo() {
|
||||
if [ -d $GITBLIT_INITIAL_REPO ]; then
|
||||
return
|
||||
fi
|
||||
|
||||
create_repo $GITBLIT_INITIAL_REPO
|
||||
}
|
||||
|
||||
shopt -s nullglob
|
||||
if [ ! -f /var/local/gitblit_firststart ]; then
|
||||
FIRSTSTART=1
|
||||
else
|
||||
FIRSTSTART=0
|
||||
fi
|
||||
|
||||
$JAVA_HOME/bin/java -jar $GITBLIT_PATH/gitblit.jar --httpsPort $GITBLIT_HTTPS_PORT --httpPort $GITBLIT_HTTP_PORT --baseFolder $GITBLIT_BASE_FOLDER
|
||||
if [ $FIRSTSTART = 1 ]; then
|
||||
apply_base_data
|
||||
|
||||
echo "
|
||||
Applying configuration from /config
|
||||
"
|
||||
apply_config
|
||||
touch /var/local/gitblit_firststart
|
||||
fi
|
||||
|
||||
|
||||
if [[ -n $GITBLIT_INITIAL_REPO ]]; then
|
||||
create_initial_repo
|
||||
fi
|
||||
apply_repos
|
||||
|
||||
cd $GITBLIT_PATH
|
||||
$JAVA_HOME/bin/java -jar $GITBLIT_PATH/gitblit.jar \
|
||||
--httpsPort $GITBLIT_HTTPS_PORT --httpPort $GITBLIT_HTTP_PORT \
|
||||
--baseFolder $GITBLIT_BASE_FOLDER
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
FROM itzg/ubuntu-openjdk-7
|
||||
|
||||
MAINTAINER itzg
|
||||
LABEL maintainer "itzg"
|
||||
|
||||
RUN apt-get install -y curl unzip
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
FROM ubuntu:trusty
|
||||
|
||||
MAINTAINER itzg
|
||||
LABEL maintainer "itzg"
|
||||
|
||||
ENV APT_GET_UPDATE 2014-09-18
|
||||
|
||||
@@ -21,4 +21,3 @@ EXPOSE 4000
|
||||
|
||||
ADD start.sh /start
|
||||
CMD ["/start"]
|
||||
|
||||
|
||||
@@ -1,13 +1,17 @@
|
||||
FROM itzg/ubuntu-openjdk-7
|
||||
FROM java:openjdk-8u102-jdk
|
||||
|
||||
MAINTAINER itzg
|
||||
LABEL maintainer "itzg"
|
||||
|
||||
RUN DEBIAN_FRONTEND=noninteractive apt-get -y install curl && apt-get clean
|
||||
RUN apt-get update && \
|
||||
DEBIAN_FRONTEND=noninteractive apt-get install -y \
|
||||
graphviz \
|
||||
&& apt-get clean
|
||||
|
||||
ADD download-and-start.sh /download-and-start
|
||||
ENV JENKINS_HOME=/data
|
||||
|
||||
ENV JENKINS_HOME /data
|
||||
VOLUME ["/data"]
|
||||
VOLUME ["/data", "/root", "/opt/jenkins"]
|
||||
EXPOSE 8080 38252
|
||||
|
||||
CMD ["/download-and-start"]
|
||||
COPY download-and-start.sh /opt/download-and-start
|
||||
|
||||
CMD ["/opt/download-and-start"]
|
||||
|
||||
@@ -18,21 +18,6 @@ would be:
|
||||
|
||||
ID=$(docker run -d -p 8080:8080 -v /SOME_HOST_DIR:/data itzg/jenkins
|
||||
|
||||
# Entering the container to perform manual config
|
||||
|
||||
As with any Docker container, you can run a shell within the running container:
|
||||
|
||||
docker exec -it $ID bash
|
||||
|
||||
A more realistic example is installing git, openjdk-7-jdk, etc:
|
||||
|
||||
docker exec $ID apt-get update
|
||||
docker exec $ID apt-get install -y git openjdk-7-jdk
|
||||
|
||||
and then Configure the JDK in Jenkins:
|
||||
|
||||

|
||||
|
||||
# Enabling Jenkins slave agents
|
||||
|
||||
By default, Jenkins will pick a random port to allow slave nodes launched
|
||||
@@ -47,3 +32,20 @@ Launch your Jenkins container using
|
||||
and configure the port in the Global Security settings:
|
||||
|
||||

|
||||
|
||||
# Image Parameters
|
||||
|
||||
## Volumes
|
||||
|
||||
* `/data` - a majority of the Jenkins content is maintained here, such as workspaces
|
||||
* `/root` - some tools, such as Maven, utilize the home directory for default repository storage
|
||||
* `/opt/jenkins` - the installed distribution is expanded here
|
||||
|
||||
## Ports
|
||||
|
||||
* `8080` - for the web UI
|
||||
* `38252` - for slave incoming JMX access
|
||||
|
||||
## Environment Variables
|
||||
|
||||
* `JENKINS_OPTS` - passed to the initial Java invocation of Jenkins
|
||||
|
||||
@@ -26,4 +26,4 @@ fi
|
||||
|
||||
|
||||
cd /opt/jenkins
|
||||
exec java -jar jenkins.war
|
||||
exec java $JENKINS_OPTS -jar jenkins.war
|
||||
|
||||
@@ -1,13 +1,14 @@
|
||||
FROM itzg/ubuntu-openjdk-7
|
||||
FROM openjdk:8u111-jre
|
||||
|
||||
MAINTAINER itzg
|
||||
LABEL maintainer "itzg"
|
||||
|
||||
ENV KIBANA_VERSION 4.1.1
|
||||
ENV KIBANA_VERSION 5.1.2
|
||||
|
||||
RUN wget -q -O /tmp/kibana.tgz https://download.elasticsearch.org/kibana/kibana/kibana-${KIBANA_VERSION}-linux-x64.tar.gz
|
||||
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-x64
|
||||
|
||||
ENV KIBANA_HOME /opt/kibana-$KIBANA_VERSION-linux-x86_64
|
||||
|
||||
# Simplify for cross-container
|
||||
ENV ES_URL http://es:9200
|
||||
|
||||
12
kibana/docker-compose-test.yml
Normal file
12
kibana/docker-compose-test.yml
Normal file
@@ -0,0 +1,12 @@
|
||||
version: '2'
|
||||
|
||||
services:
|
||||
es:
|
||||
build: ../elasticsearch
|
||||
ports:
|
||||
- "9200:9200"
|
||||
|
||||
kibana:
|
||||
build: .
|
||||
ports:
|
||||
- "5601:5601"
|
||||
@@ -1,6 +1,5 @@
|
||||
#!/bin/bash
|
||||
#!/bin/sh
|
||||
|
||||
OPTS="-e $ES_URL"
|
||||
OPTS="-e $ES_URL -H $HOSTNAME"
|
||||
|
||||
exec bin/kibana $OPTS
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
FROM itzg/ubuntu-openjdk-7
|
||||
|
||||
MAINTAINER itzg
|
||||
LABEL maintainer "itzg"
|
||||
|
||||
ENV LOGSTASH_VERSION 1.5.0-1
|
||||
|
||||
|
||||
@@ -1,34 +1,50 @@
|
||||
FROM itzg/ubuntu-openjdk-7
|
||||
FROM alpine
|
||||
|
||||
MAINTAINER itzg
|
||||
|
||||
ENV APT_GET_UPDATE 2015-03-28
|
||||
RUN apt-get update
|
||||
LABEL maintainer "itzg"
|
||||
|
||||
RUN DEBIAN_FRONTEND=noninteractive apt-get install -y libmozjs-24-bin imagemagick && apt-get clean
|
||||
RUN update-alternatives --install /usr/bin/js js /usr/bin/js24 100
|
||||
RUN echo "http://dl-3.alpinelinux.org/alpine/v3.5/community/" >> /etc/apk/repositories &&\
|
||||
apk update && \
|
||||
apk add \
|
||||
openjdk8-jre-base \
|
||||
openssl \
|
||||
imagemagick \
|
||||
lsof \
|
||||
su-exec \
|
||||
bash \
|
||||
curl \
|
||||
git \
|
||||
jq \
|
||||
mysql-client \
|
||||
python python-dev && \
|
||||
rm -rf /var/cache/apk/*
|
||||
|
||||
RUN wget -O /usr/bin/jsawk https://github.com/micha/jsawk/raw/master/jsawk
|
||||
RUN chmod +x /usr/bin/jsawk
|
||||
RUN useradd -M -s /bin/false --uid 1000 minecraft \
|
||||
RUN addgroup -g 1000 minecraft \
|
||||
&& adduser -Ss /bin/false -u 1000 -G minecraft -h /home/minecraft minecraft \
|
||||
&& mkdir /data \
|
||||
&& chown minecraft:minecraft /data
|
||||
&& mkdir /config \
|
||||
&& mkdir /mods \
|
||||
&& mkdir /plugins \
|
||||
&& chown minecraft:minecraft /data /config /mods /plugins /home/minecraft
|
||||
|
||||
EXPOSE 25565
|
||||
EXPOSE 25565 25575
|
||||
|
||||
ADD https://github.com/itzg/restify/releases/download/1.0.4/restify_linux_amd64 /usr/local/bin/restify
|
||||
ADD https://github.com/itzg/rcon-cli/releases/download/1.3/rcon-cli_linux_amd64 /usr/local/bin/rcon-cli
|
||||
COPY start.sh /start
|
||||
COPY start-minecraft.sh /start-minecraft
|
||||
COPY mcadmin.jq /usr/share
|
||||
RUN chmod +x /usr/local/bin/*
|
||||
|
||||
VOLUME ["/data"]
|
||||
VOLUME ["/data","/mods","/config","/plugins","/home/minecraft"]
|
||||
COPY server.properties /tmp/server.properties
|
||||
WORKDIR /data
|
||||
|
||||
CMD [ "/start" ]
|
||||
ENTRYPOINT [ "/start" ]
|
||||
|
||||
# Special marker ENV used by MCCY management tool
|
||||
ENV MC_IMAGE=YES
|
||||
|
||||
ENV UID=1000
|
||||
ENV MOTD A Minecraft Server Powered by Docker
|
||||
ENV JVM_OPTS -Xmx1024M -Xms1024M
|
||||
ENV TYPE=VANILLA VERSION=LATEST FORGEVERSION=RECOMMENDED LEVEL=world PVP=true DIFFICULTY=easy
|
||||
ENV UID=1000 GID=1000 \
|
||||
MOTD="A Minecraft Server Powered by Docker" \
|
||||
JVM_XX_OPTS="-XX:+UseG1GC" MEMORY="1G" \
|
||||
TYPE=VANILLA VERSION=LATEST FORGEVERSION=RECOMMENDED LEVEL=world PVP=true DIFFICULTY=easy \
|
||||
ENABLE_RCON=true RCON_PORT=25575 RCON_PASSWORD=minecraft \
|
||||
LEVEL_TYPE=DEFAULT GENERATOR_SETTINGS= WORLD= MODPACK= ONLINE_MODE=TRUE CONSOLE=true
|
||||
|
||||
1
minecraft-server/Minecraft server containment.xml
Normal file
1
minecraft-server/Minecraft server containment.xml
Normal file
@@ -0,0 +1 @@
|
||||
<mxfile userAgent="Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/57.0.2987.110 Safari/537.36" version="6.4.4" editor="www.draw.io" type="github"><diagram name="Page-1">1VVNc5swEP01HDMDUiDOMbGd5pK2Ux96VkGAxgJRIRvcX9+VWD40ODOZ1j0Uz9jS2w+t3ts1Ad1W/SfNmvJNZVwGJMz6gO4CQjZRCN8WuAxA8vgwAIUW2QBFM3AQvziCGFecRMZbz9EoJY1ofDBVdc1T42FMa9X5brmS/qkNK/gKOKRMrtHvIjMlolEYzoZXLooSj97EaPjB0mOh1anG8wJCc/cM5oqNudC/LVmmugVE9wHdaqXMsKr6LZeW2pG2Ie7lHetUt+a1+UgAGQLOTJ74WHEiIfQ5E2dbn7kgJ8nPky3q2fDe3DEpijqgT+AheW5mK6wK/HVZ2obVI7ZT6ZFrCHlVrRkdoLSlzwJ2BYwo8WohXSkMPzQstfsOWhCcSlNJ2EX21JFVu8mFlFsllXahdJ/YD+Bnro0AyZ+Gu+yMslnwZjt3LVd/KurCpgptLlWbA5aBXNs0vH+X/mgSFWaFq4obfQEXDKDYBhd/2809RzeIlYt2mxwZ9nkxZZ61hgXKfV16upK+EjBMmuXmruX67KSCATMMYL2SwDU5z5DkvxAE52NNvdHqyBeOoXs8UWIbplP8A3ES3UCVja/K41oVEl5RJYpuoMr9SpU34B+Qr0rD0ITD0JE4TuI/nopwLcKLexYi6OFet6CT3Pt8TjwtCI3IFUJv0eXxis9v2y+fr/D58P/yGf87PmE7v4ycbfHCp/vf</diagram></mxfile>
|
||||
@@ -1,10 +1,14 @@
|
||||
|
||||
[](https://hub.docker.com/r/itzg/minecraft-server/)
|
||||
[](https://hub.docker.com/r/itzg/minecraft-server/)
|
||||
|
||||
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
|
||||
latest snapshot. See the *Versions* section below for more information.
|
||||
|
||||
To simply use the latest stable version, run
|
||||
|
||||
docker run -d -p 25565:25565 itzg/minecraft-server
|
||||
docker run -d -p 25565:25565 --name mc itzg/minecraft-server
|
||||
|
||||
where the standard server port, 25565, will be exposed on your host machine.
|
||||
|
||||
@@ -31,6 +35,24 @@ With that you can easily view the logs, stop, or re-start the container:
|
||||
|
||||
## Interacting with the server
|
||||
|
||||
[RCON](http://wiki.vg/RCON) is enabled by default, so you can `exec` into the container to
|
||||
access the Minecraft server console:
|
||||
|
||||
```
|
||||
docker exec -i mc rcon-cli
|
||||
```
|
||||
|
||||
Note: The `-i` is required for interactive use of rcon-cli.
|
||||
|
||||
To run a simple, one-shot command, such as stopping a Minecraft server, pass the command as
|
||||
arguments to `rcon-cli`, such as:
|
||||
|
||||
```
|
||||
docker exec mc rcon-cli stop
|
||||
```
|
||||
|
||||
_The `-i` is not needed in this case._
|
||||
|
||||
In order to attach and interact with the Minecraft server, add `-it` when starting the container, such as
|
||||
|
||||
docker run -d -it -p 25565:25565 --name mc itzg/minecraft-server
|
||||
@@ -56,7 +78,7 @@ Mojang now requires accepting the [Minecraft EULA](https://account.mojang.com/do
|
||||
|
||||
such as
|
||||
|
||||
docker run -d -it -e EULA=TRUE -p 25565:25565 itzg/minecraft-server
|
||||
docker run -d -it -e EULA=TRUE -p 25565:25565 --name mc itzg/minecraft-server
|
||||
|
||||
## Attaching data directory to host filesystem
|
||||
|
||||
@@ -68,15 +90,16 @@ to map a directory on your host machine to the container's `/data` directory, su
|
||||
When attached in this way you can stop the server, edit the configuration under your attached `/path/on/host`
|
||||
and start the server again with `docker start CONTAINERID` to pick up the new configuration.
|
||||
|
||||
**NOTE**: By default, the files in the attached directory will be owned by the host user with UID of 1000.
|
||||
You can use an different UID by passing the option:
|
||||
**NOTE**: By default, the files in the attached directory will be owned by the host user with UID of 1000 and host group with GID of 1000.
|
||||
You can use an different UID and GID by passing the options:
|
||||
|
||||
-e UID=1000
|
||||
-e UID=1000 -e GID=1000
|
||||
|
||||
replacing 1000 with a UID that is present on the host.
|
||||
Here is one way to find the UID given a username:
|
||||
replacing 1000 with a UID and GID that is present on the host.
|
||||
Here is one way to find the UID and GID:
|
||||
|
||||
grep some_host_user /etc/passwd|cut -d: -f3
|
||||
id some_host_user
|
||||
getent group some_host_group
|
||||
|
||||
## Versions
|
||||
|
||||
@@ -102,9 +125,15 @@ but you can also choose to run a specific version with `-e FORGEVERSION=10.13.4.
|
||||
|
||||
$ docker run -d -v /path/on/host:/data -e VERSION=1.7.10 \
|
||||
-e TYPE=FORGE -e FORGEVERSION=10.13.4.1448 \
|
||||
-p 25565:25565 -e EULA=TRUE itzg/minecraft-server
|
||||
-p 25565:25565 -e EULA=TRUE --name mc itzg/minecraft-server
|
||||
|
||||
In order to add mods, you will need to attach the container's `/data` directory
|
||||
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:
|
||||
@@ -124,8 +153,238 @@ the `/path/on/host` folder contents look like:
|
||||
If you add mods while the container is running, you'll need to restart it to pick those
|
||||
up:
|
||||
|
||||
docker stop $ID
|
||||
docker start $ID
|
||||
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 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.
|
||||
|
||||
docker run -d -v /path/on/host:/data \
|
||||
-e TYPE=SPIGOT -e VERSION=1.8 \
|
||||
-p 25565:25565 -e EULA=TRUE --name mc itzg/minecraft-server
|
||||
|
||||
If you are hosting your own copy of Bukkit/Spigot you can override the download URLs with:
|
||||
* -e BUKKIT_DOWNLOAD_URL=<url>
|
||||
* -e SPIGOT_DOWNLOAD_URL=<url>
|
||||
|
||||
You can build spigot from source by adding `-e BUILD_FROM_SOURCE=true`
|
||||
|
||||
__NOTE: to avoid pegging the CPU when running Spigot,__ you will need to
|
||||
pass `--noconsole` at the very end of the command line and not use `-it`. For example,
|
||||
|
||||
docker run -d -v /path/on/host:/data \
|
||||
-e TYPE=SPIGOT -e VERSION=1.8 \
|
||||
-p 25565:25565 -e EULA=TRUE --name mc itzg/minecraft-server --noconsole
|
||||
|
||||
|
||||
You can install Bukkit plugins in two ways...
|
||||
|
||||
### 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 plugins to the `/path/on/host/plugins` folder you chose. From the example above,
|
||||
the `/path/on/host` folder contents look like:
|
||||
|
||||
```
|
||||
/path/on/host
|
||||
├── plugins
|
||||
│ └── ... INSTALL PLUGINS HERE ...
|
||||
├── ops.json
|
||||
├── server.properties
|
||||
├── whitelist.json
|
||||
└── ...
|
||||
```
|
||||
|
||||
If you add plugins 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 is one additional volume that can be mounted; `/plugins`.
|
||||
Any files in this filesystem will be copied over to the main
|
||||
`/data/plugins` filesystem before starting Minecraft.
|
||||
|
||||
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 PaperSpigot server
|
||||
|
||||
Enable PaperSpigot server mode by adding a `-e TYPE=PAPER -e VERSION=1.9.4` to your command-line.
|
||||
|
||||
docker run -d -v /path/on/host:/data \
|
||||
-e TYPE=PAPER -e VERSION=1.9.4 \
|
||||
-p 25565:25565 -e EULA=TRUE --name mc itzg/minecraft-server
|
||||
|
||||
__NOTE: to avoid pegging the CPU when running PaperSpigot,__ you will need to
|
||||
pass `--noconsole` at the very end of the command line and not use `-it`. For example,
|
||||
|
||||
docker run -d -v /path/on/host:/data \
|
||||
-e TYPE=PAPER -e VERSION=1.9.4 \
|
||||
-p 25565:25565 -e EULA=TRUE --name mc itzg/minecraft-server --noconsole
|
||||
|
||||
If you are hosting your own copy of PaperSpigot you can override the download URL with:
|
||||
* -e PAPER_DOWNLOAD_URL=<url>
|
||||
|
||||
You can install Bukkit plugins in two ways...
|
||||
|
||||
### Using the /data volume
|
||||
|
||||
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 plugins to the `/path/on/host/plugins` folder you chose. From the example above,
|
||||
the `/path/on/host` folder contents look like:
|
||||
|
||||
```
|
||||
/path/on/host
|
||||
├── plugins
|
||||
│ └── ... INSTALL PLUGINS HERE ...
|
||||
├── ops.json
|
||||
├── server.properties
|
||||
├── whitelist.json
|
||||
└── ...
|
||||
```
|
||||
|
||||
If you add plugins 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 is one additional volume that can be mounted; `/plugins`.
|
||||
Any files in this filesystem will be copied over to the main
|
||||
`/data/plugins` filesystem before starting Minecraft.
|
||||
|
||||
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
|
||||
|
||||
Enable this server mode by adding a `-e TYPE=FTB` 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`
|
||||
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 \
|
||||
-e FTB_SERVER_MOD=FTBPresentsSkyfactory3Server_3.0.6.zip \
|
||||
-p 25565:25565 -e EULA=TRUE --name mc itzg/minecraft-server
|
||||
|
||||
Instead of explicitly downloading a modpack from the Feed the Beast site, you
|
||||
can you set `FTB_SERVER_MOD` to the **server** URL of a modpack, such as
|
||||
|
||||
$ docker run ... \
|
||||
-e TYPE=FTB \
|
||||
-e FTB_SERVER_MOD=https://www.feed-the-beast.com/projects/ftb-infinity-lite-1-10/files/2402889
|
||||
|
||||
### Using the /data volume
|
||||
|
||||
You must use a persistent `/data` mount for this type of server.
|
||||
|
||||
To do this, you will need to attach the container's `/data` directory
|
||||
(see "Attaching data directory to host filesystem”).
|
||||
|
||||
If the modpack is updated and you want to run the new version on your
|
||||
server, you stop and remove the container:
|
||||
|
||||
docker stop mc
|
||||
docker rm mc
|
||||
|
||||
Do not erase anything from your /data directory (unless you know of
|
||||
specific mods that have been removed from the modpack). Download the
|
||||
updated FTB server modpack and copy it to `/data`. Start a new container
|
||||
with `FTB_SERVER_MOD` specifying the updated modpack file.
|
||||
|
||||
$ docker run -d -v /path/on/host:/data -e TYPE=FTB \
|
||||
-e FTB_SERVER_MOD=FTBPresentsSkyfactory3Server_3.0.7.zip \
|
||||
-p 25565:25565 -e EULA=TRUE --name mc itzg/minecraft-server
|
||||
|
||||
### FTB server JVM options
|
||||
|
||||
An FTB server modpack contains its own startup script that launches the
|
||||
JVM and it does not use the `JVM_OPTS` environment variable. Instead
|
||||
you can use `MIN_RAM` and `MAX_RAM` variables. These are appended to
|
||||
the JVM `-Xms` and `-Xmx` options. For example, `-e MIN_RAM=2G` results
|
||||
in `-Xms2G` passed to the JVM.
|
||||
|
||||
Additionally, `PERMGEN_SIZE` is passed on to `-XX:PermSize`. Here is an
|
||||
example:
|
||||
|
||||
$ docker run -d -v /path/on/host:/data -e TYPE=FTB \
|
||||
-e MIN_RAM=1G -e MAX_RAM=2G -e PERMGEN_SIZE=512M \
|
||||
-e FTB_SERVER_MOD=FTBPresentsSkyfactory3Server_3.0.6.zip \
|
||||
-p 25565:25565 -e EULA=TRUE --name mc itzg/minecraft-server
|
||||
|
||||
Note: The FTB server start script will also override other options,
|
||||
like `MOTD`.
|
||||
|
||||
## Using Docker Compose
|
||||
|
||||
Rather than type the server options below, the port mappings above, etc
|
||||
every time you want to create new Minecraft server, you can now use
|
||||
[Docker Compose](https://docs.docker.com/compose/). Start with a
|
||||
`docker-compose.yml` file like the following:
|
||||
|
||||
```
|
||||
minecraft-server:
|
||||
ports:
|
||||
- "25565:25565"
|
||||
|
||||
environment:
|
||||
EULA: "TRUE"
|
||||
|
||||
image: itzg/minecraft-server
|
||||
|
||||
container_name: mc
|
||||
|
||||
tty: true
|
||||
stdin_open: true
|
||||
restart: always
|
||||
```
|
||||
|
||||
and in the same directory as that file run
|
||||
|
||||
docker-compose up -d
|
||||
|
||||
Now, go play...or adjust the `environment` section to configure
|
||||
this server instance.
|
||||
|
||||
## Server configuration
|
||||
|
||||
@@ -133,12 +392,20 @@ up:
|
||||
|
||||
The difficulty level (default: `easy`) can be set like:
|
||||
|
||||
docker run -d -e DIFFICULTY=hard
|
||||
docker run -d -e DIFFICULTY=hard ...
|
||||
|
||||
Valid values are: `peaceful`, `easy`, `normal`, and `hard`, and an
|
||||
error message will be output in the logs if it's not one of these
|
||||
values.
|
||||
|
||||
### Whitelist Players
|
||||
|
||||
To whitelist players for your Minecraft server, pass the Minecraft usernames separated by commas via the `WHITELIST` environment variable, such as
|
||||
|
||||
docker run -d -e WHITELIST=user1,user2 ...
|
||||
|
||||
If the `WHITELIST` environment variable is not used, any user can join your Minecraft server if it's publicly accessible.
|
||||
|
||||
### Op/Administrator Players
|
||||
|
||||
To add more "op" (aka adminstrator) users to your Minecraft server, pass the Minecraft usernames separated by commas via the `OPS` environment variable, such as
|
||||
@@ -152,6 +419,114 @@ downloaded, scaled, and converted from any other image format:
|
||||
|
||||
docker run -d -e ICON=http://..../some/image.png ...
|
||||
|
||||
### Rcon
|
||||
|
||||
To use rcon use the `ENABLE_RCON` and `RCON_PASSORD` variables.
|
||||
By default rcon port will be `25575` but can easily be changed with the `RCON_PORT` variable.
|
||||
|
||||
docker run -d -e ENABLE_RCON=true -e RCON_PASSWORD=testing
|
||||
|
||||
### Query
|
||||
|
||||
Enabling this will enable the gamespy query protocol.
|
||||
By default the query port will be `25565` (UDP) but can easily be changed with the `QUERY_PORT` variable.
|
||||
|
||||
docker run -d -e ENABLE_QUERY=true
|
||||
|
||||
|
||||
### Max players
|
||||
|
||||
By default max players is 20, you can increase this with the `MAX_PLAYERS` variable.
|
||||
|
||||
docker run -d -e MAX_PLAYERS=50
|
||||
|
||||
|
||||
### Max world size
|
||||
|
||||
This sets the maximum possible size in blocks, expressed as a radius, that the world border can obtain.
|
||||
|
||||
docker run -d -e MAX_WORLD_SIZE=10000
|
||||
|
||||
### Allow Nether
|
||||
|
||||
Allows players to travel to the Nether.
|
||||
|
||||
docker run -d -e ALLOW_NETHER=true
|
||||
|
||||
### Announce Player Achievements
|
||||
|
||||
Allows server to announce when a player gets an achievement.
|
||||
|
||||
docker run -d -e ANNOUNCE_PLAYER_ACHIEVEMENTS=true
|
||||
|
||||
### Enable Command Block
|
||||
|
||||
Enables command blocks
|
||||
|
||||
docker run -d -e ENABLE_COMMAND_BLOCK=true
|
||||
|
||||
### Force Gamemode
|
||||
|
||||
Force players to join in the default game mode.
|
||||
|
||||
* false - Players will join in the gamemode they left in.
|
||||
* true - Players will always join in the default gamemode.
|
||||
|
||||
`docker run -d -e FORCE_GAMEMODE=false`
|
||||
|
||||
### Generate Structures
|
||||
|
||||
Defines whether structures (such as villages) will be generated.
|
||||
|
||||
* false - Structures will not be generated in new chunks.
|
||||
* true - Structures will be generated in new chunks.
|
||||
|
||||
`docker run -d -e GENERATE_STRUCTURES=true`
|
||||
|
||||
### Hardcore
|
||||
|
||||
If set to true, players will be set to spectator mode if they die.
|
||||
|
||||
docker run -d -e HARDCORE=false
|
||||
|
||||
### Max Build Height
|
||||
|
||||
The maximum height in which building is allowed.
|
||||
Terrain may still naturally generate above a low height limit.
|
||||
|
||||
docker run -d -e MAX_BUILD_HEIGHT=256
|
||||
|
||||
### Max Tick Time
|
||||
|
||||
The maximum number of milliseconds a single tick may take before the server watchdog stops the server with the message, A single server tick took 60.00 seconds (should be max 0.05); Considering it to be crashed, server will forcibly shutdown. Once this criteria is met, it calls System.exit(1).
|
||||
Setting this to -1 will disable watchdog entirely
|
||||
|
||||
docker run -d -e MAX_TICK_TIME=60000
|
||||
|
||||
### Spawn Animals
|
||||
|
||||
Determines if animals will be able to spawn.
|
||||
|
||||
docker run -d -e SPAWN_ANIMALS=true
|
||||
|
||||
### Spawn Monsters
|
||||
|
||||
Determines if monsters will be spawned.
|
||||
|
||||
docker run -d -e SPAWN_MONSTERS=true
|
||||
|
||||
### Spawn NPCs
|
||||
|
||||
Determines if villagers will be spawned.
|
||||
|
||||
docker run -d -e SPAWN_NPCS=true
|
||||
|
||||
### View Distance
|
||||
Sets the amount of world data the server sends the client, measured in chunks in each direction of the player (radius, not diameter).
|
||||
It determines the server-side viewing distance.
|
||||
|
||||
docker run -d -e VIEW_DISTANCE=10
|
||||
|
||||
### Level Seed
|
||||
|
||||
If you want to create the Minecraft level with a specific seed, use `SEED`, such as
|
||||
@@ -167,6 +542,8 @@ shortcut values:
|
||||
|
||||
* creative
|
||||
* survival
|
||||
* adventure
|
||||
* spectator (only for Minecraft 1.8 or later)
|
||||
|
||||
For example:
|
||||
|
||||
@@ -176,33 +553,104 @@ For example:
|
||||
|
||||
The message of the day, shown below each server entry in the UI, can be changed with the `MOTD` environment variable, such as
|
||||
|
||||
docker run -d -e 'MOTD=My Server' ...
|
||||
docker run -d -e 'MOTD=My Server' ...
|
||||
|
||||
If you leave it off, the last used or default message will be used. _The example shows how to specify a server
|
||||
message of the day that contains spaces by putting quotes around the whole thing._
|
||||
|
||||
### PVP Mode
|
||||
|
||||
By default servers are created with player-vs-player (PVP) mode enabled. You can disable this with the `PVP`
|
||||
By default, servers are created with player-vs-player (PVP) mode enabled. You can disable this with the `PVP`
|
||||
environment variable set to `false`, such as
|
||||
|
||||
docker run -d -e PVP=false ...
|
||||
|
||||
### 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
|
||||
|
||||
* DEFAULT
|
||||
* FLAT
|
||||
* LARGEBIOMES
|
||||
* AMPLIFIED
|
||||
* CUSTOMIZED
|
||||
|
||||
Descriptions are available at the [gamepedia](http://minecraft.gamepedia.com/Server.properties).
|
||||
|
||||
When using a level type of `FLAT` and `CUSTOMIZED`, you can further configure the world generator
|
||||
by passing [custom generator settings](http://minecraft.gamepedia.com/Superflat).
|
||||
**Since generator settings usually have ;'s in them, surround the -e value with a single quote, like below.**
|
||||
|
||||
For example (just the `-e` bits):
|
||||
|
||||
-e LEVEL_TYPE=flat -e 'GENERATOR_SETTINGS=3;minecraft:bedrock,3*minecraft:stone,52*minecraft:sandstone;2;'
|
||||
|
||||
### World Save Name
|
||||
|
||||
You can either switch between world saves or run multiple containers with different saves by using the `LEVEL` option,
|
||||
where the default is "world":
|
||||
|
||||
docker run -d -e LEVEL=bonus ...
|
||||
docker run -d -e LEVEL=bonus ...
|
||||
|
||||
**NOTE:** if running multiple containers be sure to either specify a different `-v` host directory for each
|
||||
`LEVEL` in use or don't use `-v` and the container's filesystem will keep things encapsulated.
|
||||
|
||||
## JVM Configuration
|
||||
### Downloadable world
|
||||
|
||||
Instead of mounting the `/data` volume, you can instead specify the URL of
|
||||
a ZIP file containing an archived world. This will be downloaded, and
|
||||
unpacked in the `/data` directory; if it does not contain a subdirectory
|
||||
called `world/` then it will be searched for a file `level.dat` and the
|
||||
containing subdirectory renamed to `world`. This means that most of the
|
||||
archived Minecraft worlds downloadable from the Internet will already be in
|
||||
the correct format.
|
||||
|
||||
The ZIP file may also contain a `server.properties` file and `modules`
|
||||
directory, if required.
|
||||
|
||||
docker run -d -e WORLD=http://www.example.com/worlds/MySave.zip ...
|
||||
|
||||
**NOTE:** Unless you also mount `/data` as an external volume, this world
|
||||
will be deleted when the container is deleted.
|
||||
|
||||
**NOTE:** This URL must be accessible from inside the container. Therefore,
|
||||
you should use an IP address or a globally resolveable FQDN, or else the
|
||||
name of a linked container.
|
||||
|
||||
### Downloadable mod/plugin pack for Forge, Bukkit, and Spigot Servers
|
||||
|
||||
Like the `WORLD` option above, you can specify the URL of a "mod pack"
|
||||
to download and install into `mods` for Forge or `plugins` for Bukkit/Spigot.
|
||||
To use this option pass the environment variable `MODPACK`, such as
|
||||
|
||||
docker run -d -e MODPACK=http://www.example.com/mods/modpack.zip ...
|
||||
|
||||
**NOTE:** The referenced URL must be a zip file with one or more jar files at the
|
||||
top level of the zip archive. Make sure the jars are compatible with the
|
||||
particular `TYPE` of server you are running.
|
||||
|
||||
### Online mode
|
||||
|
||||
By default, server checks connecting players against Minecraft's account database. If you want to create an offline server or your server is not connected to the internet, you can disable the server to try connecting to minecraft.net to authenticate players with environment variable `ONLINE_MODE`, like this
|
||||
|
||||
docker run -d -e ONLINE_MODE=FALSE ...
|
||||
|
||||
## Miscellaneous Options
|
||||
|
||||
### Memory Limit
|
||||
|
||||
The Java memory limit can be adjusted using the `JVM_OPTS` environment variable, where the default is
|
||||
the setting shown in the example (max and min at 1024 MB):
|
||||
By default, the image declares a Java initial and maximum memory limit of 1 GB. There are several
|
||||
ways to adjust the memory settings:
|
||||
|
||||
docker run -e 'JVM_OPTS=-Xmx1024M -Xms1024M' ...
|
||||
* `MEMORY`, "1G" by default, can be used to adjust both initial (`Xms`) and max (`Xmx`)
|
||||
memory settings of the JVM
|
||||
* `INIT_MEMORY`, independently sets the initial heap size
|
||||
* `MAX_MEMORY`, independently sets the max heap size
|
||||
|
||||
The values of all three are passed directly to the JVM and support format/units as
|
||||
`<size>[g|G|m|M|k|K]`.
|
||||
|
||||
### /data ownership
|
||||
|
||||
In order to adapt to differences in `UID` and `GID` settings the entry script will attempt to correct ownership and writability of the `/data` directory. This logic can be disabled by setting `-e SKIP_OWNERSHIP_FIX=TRUE`.
|
||||
|
||||
29
minecraft-server/docker-compose-big.yml
Normal file
29
minecraft-server/docker-compose-big.yml
Normal file
@@ -0,0 +1,29 @@
|
||||
version: '3'
|
||||
|
||||
services:
|
||||
minecraft:
|
||||
ports:
|
||||
- "25565:25565"
|
||||
volumes:
|
||||
- "mcbig:/data"
|
||||
environment:
|
||||
EULA: "TRUE"
|
||||
MAX_MEMORY: 32G
|
||||
MAX_BUILD_HEIGHT: 256
|
||||
VIEW_DISTANCE: 15
|
||||
LEVEL_TYPE: LARGEBIOMES
|
||||
MAX_PLAYERS: 100
|
||||
CONSOLE: "false"
|
||||
image: itzg/minecraft-server
|
||||
restart: always
|
||||
rcon:
|
||||
image: itzg/rcon
|
||||
ports:
|
||||
- "4326:4326"
|
||||
- "4327:4327"
|
||||
volumes:
|
||||
- "rcon:/opt/rcon-web-admin/db"
|
||||
|
||||
volumes:
|
||||
mcbig:
|
||||
rcon:
|
||||
27
minecraft-server/docker-compose.yml
Normal file
27
minecraft-server/docker-compose.yml
Normal file
@@ -0,0 +1,27 @@
|
||||
version: '3'
|
||||
|
||||
services:
|
||||
minecraft:
|
||||
image: itzg/minecraft-server
|
||||
ports:
|
||||
- "25565:25565"
|
||||
volumes:
|
||||
- "mc:/data"
|
||||
environment:
|
||||
EULA: "TRUE"
|
||||
CONSOLE: "false"
|
||||
ENABLE_RCON: "true"
|
||||
RCON_PASSWORD: "testing"
|
||||
RCON_PORT: 28016
|
||||
restart: always
|
||||
rcon:
|
||||
image: itzg/rcon
|
||||
ports:
|
||||
- "4326:4326"
|
||||
- "4327:4327"
|
||||
volumes:
|
||||
- "rcon:/opt/rcon-web-admin/db"
|
||||
|
||||
volumes:
|
||||
mc:
|
||||
rcon:
|
||||
7
minecraft-server/mcadmin.jq
Normal file
7
minecraft-server/mcadmin.jq
Normal file
@@ -0,0 +1,7 @@
|
||||
.[] |
|
||||
select(.elements | length > 1) |
|
||||
select(.elements[].elements[] | select(.class == "version" and .text == $version)) |
|
||||
.elements[].elements[] |
|
||||
select(.class|contains("server-jar")) |
|
||||
.elements[] | select(.name="a") |
|
||||
.href
|
||||
@@ -5,11 +5,14 @@ enable-query=false
|
||||
allow-flight=false
|
||||
announce-player-achievements=true
|
||||
server-port=25565
|
||||
rcon.port=25575
|
||||
query.port=25565
|
||||
level-type=DEFAULT
|
||||
enable-rcon=false
|
||||
force-gamemode=false
|
||||
level-seed=
|
||||
server-ip=
|
||||
max-tick-time=60000
|
||||
max-build-height=256
|
||||
spawn-npcs=true
|
||||
white-list=false
|
||||
@@ -21,7 +24,7 @@ online-mode=true
|
||||
resource-pack=
|
||||
pvp=true
|
||||
difficulty=1
|
||||
enable-command-block=false
|
||||
enable-command-block=true
|
||||
player-idle-timeout=0
|
||||
gamemode=0
|
||||
max-players=20
|
||||
@@ -30,4 +33,6 @@ generate-structures=true
|
||||
view-distance=10
|
||||
spawn-protection=16
|
||||
motd=A Minecraft Server powered by Docker
|
||||
|
||||
generator-settings=
|
||||
rcon.password=
|
||||
max-world-size=29999984
|
||||
|
||||
@@ -1,5 +1,8 @@
|
||||
#!/bin/bash
|
||||
|
||||
#umask 002
|
||||
export HOME=/data
|
||||
|
||||
if [ ! -e /data/eula.txt ]; then
|
||||
if [ "$EULA" != "" ]; then
|
||||
echo "# Generated via Docker on $(date)" > eula.txt
|
||||
@@ -15,108 +18,448 @@ if [ ! -e /data/eula.txt ]; then
|
||||
fi
|
||||
fi
|
||||
|
||||
SERVER_PROPERTIES=/data/server.properties
|
||||
FTB_DIR=/data/FeedTheBeast
|
||||
VERSIONS_JSON=https://launchermeta.mojang.com/mc/game/version_manifest.json
|
||||
|
||||
echo "Checking version information."
|
||||
case $VERSION in
|
||||
LATEST)
|
||||
VANILLA_VERSION=`wget -O - https://s3.amazonaws.com/Minecraft.Download/versions/versions.json | jsawk -n 'out(this.latest.release)'`
|
||||
case "X$VERSION" in
|
||||
X|XLATEST|Xlatest)
|
||||
VANILLA_VERSION=`curl -fsSL $VERSIONS_JSON | jq -r '.latest.release'`
|
||||
;;
|
||||
SNAPSHOT)
|
||||
VANILLA_VERSION=`wget -O - https://s3.amazonaws.com/Minecraft.Download/versions/versions.json | jsawk -n 'out(this.latest.snapshot)'`
|
||||
XSNAPSHOT|Xsnapshot)
|
||||
VANILLA_VERSION=`curl -fsSL $VERSIONS_JSON | jq -r '.latest.snapshot'`
|
||||
;;
|
||||
X[1-9]*)
|
||||
VANILLA_VERSION=$VERSION
|
||||
;;
|
||||
*)
|
||||
VANILLA_VERSION=$VERSION
|
||||
VANILLA_VERSION=`curl -fsSL $VERSIONS_JSON | jq -r '.latest.release'`
|
||||
;;
|
||||
esac
|
||||
|
||||
cd /data
|
||||
|
||||
echo "Checking minecraft / forge type information."
|
||||
case $TYPE in
|
||||
VANILLA)
|
||||
SERVER="minecraft_server.$VANILLA_VERSION.jar"
|
||||
function buildSpigotFromSource {
|
||||
echo "Building Spigot $VANILLA_VERSION from source, might take a while, get some coffee"
|
||||
mkdir /data/temp
|
||||
cd /data/temp
|
||||
wget -q -P /data/temp 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
|
||||
mv craftbukkit-*.jar /data/craftbukkit_server.jar
|
||||
echo "Cleaning up"
|
||||
rm -rf /data/temp
|
||||
cd /data
|
||||
}
|
||||
|
||||
if [ ! -e $SERVER ]; then
|
||||
echo "Downloading $SERVER ..."
|
||||
wget -q https://s3.amazonaws.com/Minecraft.Download/versions/$VANILLA_VERSION/$SERVER
|
||||
function downloadSpigot {
|
||||
local match
|
||||
case "$TYPE" in
|
||||
*BUKKIT|*bukkit)
|
||||
match="Craftbukkit"
|
||||
downloadUrl=${BUKKIT_DOWNLOAD_URL}
|
||||
;;
|
||||
*)
|
||||
match="Spigot"
|
||||
downloadUrl=${SPIGOT_DOWNLOAD_URL}
|
||||
;;
|
||||
esac
|
||||
|
||||
if [[ -z $downloadUrl ]]; then
|
||||
downloadUrl=$(restify --class=jar-div https://mcadmin.net/ | \
|
||||
jq --arg version "$match $VANILLA_VERSION" -r -f /usr/share/mcadmin.jq)
|
||||
if [[ -z $downloadUrl ]]; then
|
||||
echo "ERROR: Version $VANILLA_VERSION is not supported for $TYPE"
|
||||
echo " Refer to https://mcadmin.net/ for supported versions"
|
||||
exit 2
|
||||
fi
|
||||
;;
|
||||
fi
|
||||
|
||||
FORGE)
|
||||
# norm := the official Minecraft version as Forge is tracking it. dropped the third part starting with 1.8
|
||||
case $VANILLA_VERSION in
|
||||
1.7.*)
|
||||
norm=$VANILLA_VERSION
|
||||
echo "Downloading $match"
|
||||
curl -kfsSL -o $SERVER "$downloadUrl"
|
||||
status=$?
|
||||
if [ ! -f $SERVER ]; then
|
||||
echo "ERROR: failed to download from $downloadUrl (status=$status)"
|
||||
exit 3
|
||||
fi
|
||||
|
||||
}
|
||||
|
||||
function downloadPaper {
|
||||
local build
|
||||
case "$VERSION" in
|
||||
latest|LATEST|1.10)
|
||||
build="lastSuccessfulBuild";;
|
||||
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 $SERVER
|
||||
downloadUrl=${PAPER_DOWNLOAD_URL:-https://ci.destroystokyo.com/job/PaperSpigot/$build/artifact/paperclip.jar}
|
||||
curl -fsSL -o $SERVER "$downloadUrl"
|
||||
if [ ! -f $SERVER ]; then
|
||||
echo "ERROR: failed to download from $downloadUrl (status=$?)"
|
||||
exit 3
|
||||
fi
|
||||
else
|
||||
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
|
||||
}
|
||||
|
||||
function installForge {
|
||||
TYPE=FORGE
|
||||
norm=$VANILLA_VERSION
|
||||
|
||||
case $VANILLA_VERSION in
|
||||
*.*.*)
|
||||
norm=$VANILLA_VERSION ;;
|
||||
*.*)
|
||||
norm=${VANILLA_VERSION}.0 ;;
|
||||
esac
|
||||
|
||||
echo "Checking Forge version information."
|
||||
case $FORGEVERSION in
|
||||
RECOMMENDED)
|
||||
curl -fsSL -o /tmp/forge.json http://files.minecraftforge.net/maven/net/minecraftforge/forge/promotions_slim.json
|
||||
FORGE_VERSION=$(cat /tmp/forge.json | jq -r ".promos[\"$VANILLA_VERSION-recommended\"]")
|
||||
if [ $FORGE_VERSION = null ]; then
|
||||
FORGE_VERSION=$(cat /tmp/forge.json | jq -r ".promos[\"$VANILLA_VERSION-latest\"]")
|
||||
if [ $FORGE_VERSION = null ]; then
|
||||
echo "ERROR: Version $VANILLA_VERSION is not supported by Forge"
|
||||
echo " Refer to http://files.minecraftforge.net/ for supported versions"
|
||||
exit 2
|
||||
fi
|
||||
fi
|
||||
;;
|
||||
|
||||
*)
|
||||
FORGE_VERSION=$FORGEVERSION
|
||||
;;
|
||||
esac
|
||||
|
||||
normForgeVersion=$VANILLA_VERSION-$FORGE_VERSION-$norm
|
||||
shortForgeVersion=$VANILLA_VERSION-$FORGE_VERSION
|
||||
|
||||
forgeFileNames="
|
||||
$normForgeVersion/forge-$normForgeVersion-installer.jar
|
||||
$shortForgeVersion/forge-$shortForgeVersion-installer.jar
|
||||
END
|
||||
"
|
||||
|
||||
FORGE_INSTALLER="/tmp/forge-$shortForgeVersion-installer.jar"
|
||||
installMarker=".forge-installed-$shortForgeVersion"
|
||||
|
||||
if [ ! -e $installMarker ]; then
|
||||
if [ ! -e $FORGE_INSTALLER ]; then
|
||||
echo "Downloading $normForgeVersion"
|
||||
for fn in $forgeFileNames; do
|
||||
if [ $fn == END ]; then
|
||||
echo "Unable to compute URL for $normForgeVersion"
|
||||
exit 2
|
||||
fi
|
||||
downloadUrl=http://files.minecraftforge.net/maven/net/minecraftforge/forge/$fn
|
||||
echo "...trying $downloadUrl"
|
||||
if curl -o $FORGE_INSTALLER -fsSL $downloadUrl; then
|
||||
break
|
||||
fi
|
||||
done
|
||||
|
||||
echo "Installing Forge $shortForgeVersion"
|
||||
mkdir -p mods
|
||||
tries=3
|
||||
while ((--tries >= 0)); do
|
||||
java -jar $FORGE_INSTALLER --installServer
|
||||
if [ $? == 0 ]; then
|
||||
break
|
||||
fi
|
||||
done
|
||||
if (($tries < 0)); then
|
||||
echo "Forge failed to install after several tries." >&2
|
||||
exit 10
|
||||
fi
|
||||
SERVER=$(ls *forge*$shortForgeVersion*.jar)
|
||||
if [ -z $SERVER ]; then
|
||||
echo "Unable to derive server jar for Forge $shortForgeVersion"
|
||||
exit 2
|
||||
fi
|
||||
|
||||
echo "Using server $SERVER"
|
||||
echo $SERVER > $installMarker
|
||||
fi
|
||||
else
|
||||
SERVER=$(cat $installMarker)
|
||||
fi
|
||||
}
|
||||
|
||||
function isURL {
|
||||
local value=$1
|
||||
|
||||
if [[ ${value:0:8} == "https://" || ${value:0:7} = "http://" ]]; then
|
||||
return 0
|
||||
else
|
||||
return 1
|
||||
fi
|
||||
}
|
||||
|
||||
function installFTB {
|
||||
TYPE=FEED-THE-BEAST
|
||||
|
||||
echo "Looking for Feed-The-Beast 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."
|
||||
echo "(And place the modpack in the /data directory.)"
|
||||
exit 2
|
||||
fi
|
||||
local srv_modpack=${FTB_SERVER_MOD}
|
||||
if isURL ${srv_modpack}; then
|
||||
case $srv_modpack in
|
||||
*/download)
|
||||
break;;
|
||||
*)
|
||||
srv_modpack=${srv_modpack}/download;;
|
||||
esac
|
||||
local file=$(basename $(dirname $srv_modpack))
|
||||
local downloaded=/data/${file}.zip
|
||||
echo "Downloading FTB modpack...
|
||||
$srv_modpack -> $downloaded"
|
||||
curl -sSL -o $downloaded $srv_modpack
|
||||
srv_modpack=$downloaded
|
||||
fi
|
||||
if [[ ${srv_modpack:0:5} == "data/" ]]; then
|
||||
# Prepend with "/"
|
||||
srv_modpack=/${srv_modpack}
|
||||
fi
|
||||
if [[ ! ${srv_modpack:0:1} == "/" ]]; then
|
||||
# If not an absolute path, assume file is in "/data"
|
||||
srv_modpack=/data/${srv_modpack}
|
||||
fi
|
||||
if [[ ! -f ${srv_modpack} ]]; then
|
||||
echo "FTB server modpack ${srv_modpack} not found."
|
||||
exit 2
|
||||
fi
|
||||
if [[ ! ${srv_modpack: -4} == ".zip" ]]; then
|
||||
echo "FTB server modpack ${srv_modpack} is not a zip archive."
|
||||
echo "Please set FTB_SERVER_MOD to a file with a .zip extension."
|
||||
exit 2
|
||||
fi
|
||||
|
||||
echo "Unpacking FTB server modpack ${srv_modpack} ..."
|
||||
mkdir -p ${FTB_DIR}
|
||||
unzip -o ${srv_modpack} -d ${FTB_DIR}
|
||||
cp -f /data/eula.txt ${FTB_DIR}/eula.txt
|
||||
FTB_SERVER_START=${FTB_DIR}/ServerStart.sh
|
||||
chmod a+x ${FTB_SERVER_START}
|
||||
sed -i "s/-jar/-Dfml.queryResult=confirm -jar/" ${FTB_SERVER_START}
|
||||
}
|
||||
|
||||
function installVanilla {
|
||||
SERVER="minecraft_server.$VANILLA_VERSION.jar"
|
||||
|
||||
if [ ! -e $SERVER ]; then
|
||||
echo "Downloading $SERVER ..."
|
||||
wget -q https://s3.amazonaws.com/Minecraft.Download/versions/$VANILLA_VERSION/$SERVER
|
||||
fi
|
||||
}
|
||||
|
||||
echo "Checking type information."
|
||||
case "$TYPE" in
|
||||
*BUKKIT|*bukkit|SPIGOT|spigot)
|
||||
case "$TYPE" in
|
||||
*BUKKIT|*bukkit)
|
||||
SERVER=craftbukkit_server.jar
|
||||
;;
|
||||
*)
|
||||
norm=`echo $VANILLA_VERSION | sed 's/^\([0-9]\+\.[0-9]\+\).*/\1/'`
|
||||
;;
|
||||
SERVER=spigot_server.jar
|
||||
;;
|
||||
esac
|
||||
|
||||
echo "Checking Forge version information."
|
||||
case $FORGEVERSION in
|
||||
RECOMMENDED)
|
||||
FORGE_VERSION=`wget -O - http://files.minecraftforge.net/maven/net/minecraftforge/forge/promotions_slim.json | jsawk -n "out(this.promos['$norm-recommended'])"`
|
||||
;;
|
||||
|
||||
*)
|
||||
FORGE_VERSION=$FORGEVERSION
|
||||
;;
|
||||
esac
|
||||
|
||||
# URL format changed for 1.7.10 from 10.13.2.1300
|
||||
sorted=$((echo $FORGE_VERSION; echo 10.13.2.1300) | sort -V | head -1)
|
||||
if [[ $norm == '1.7.10' && $sorted == '10.13.2.1300' ]]; then
|
||||
# if $FORGEVERSION >= 10.13.2.1300
|
||||
normForgeVersion="$norm-$FORGE_VERSION-$norm"
|
||||
else
|
||||
normForgeVersion="$norm-$FORGE_VERSION"
|
||||
if [ ! -f $SERVER ]; then
|
||||
if [[ "$BUILD_SPIGOT_FROM_SOURCE" = TRUE || "$BUILD_SPIGOT_FROM_SOURCE" = true || "$BUILD_FROM_SOURCE" = TRUE || "$BUILD_FROM_SOURCE" = true ]]; then
|
||||
buildSpigotFromSource
|
||||
else
|
||||
downloadSpigot
|
||||
fi
|
||||
fi
|
||||
# normalize on Spigot for operations below
|
||||
TYPE=SPIGOT
|
||||
;;
|
||||
|
||||
FORGE_INSTALLER="forge-$normForgeVersion-installer.jar"
|
||||
SERVER="forge-$normForgeVersion-universal.jar"
|
||||
|
||||
if [ ! -e $SERVER ]; then
|
||||
echo "Downloading $FORGE_INSTALLER ..."
|
||||
wget -q http://files.minecraftforge.net/maven/net/minecraftforge/forge/$normForgeVersion/$FORGE_INSTALLER
|
||||
echo "Installing $SERVER"
|
||||
java -jar $FORGE_INSTALLER --installServer
|
||||
PAPER|paper)
|
||||
SERVER=paper_server.jar
|
||||
if [ ! -f $SERVER ]; then
|
||||
downloadPaper
|
||||
fi
|
||||
# normalize on Spigot for operations below
|
||||
TYPE=SPIGOT
|
||||
;;
|
||||
|
||||
FORGE|forge)
|
||||
TYPE=FORGE
|
||||
installForge
|
||||
;;
|
||||
|
||||
FTB|ftb)
|
||||
TYPE=FEED-THE-BEAST
|
||||
installFTB
|
||||
;;
|
||||
|
||||
VANILLA|vanilla)
|
||||
installVanilla
|
||||
;;
|
||||
|
||||
*)
|
||||
echo "Invalid type: '$TYPE'"
|
||||
echo "Must be: VANILLA, FORGE, SPIGOT"
|
||||
exit 1
|
||||
;;
|
||||
|
||||
esac
|
||||
|
||||
|
||||
# If supplied with a URL for a world, download it and unpack
|
||||
if [[ "$WORLD" ]]; then
|
||||
case "X$WORLD" in
|
||||
X[Hh][Tt][Tt][Pp]*)
|
||||
echo "Downloading world via HTTP"
|
||||
echo "$WORLD"
|
||||
wget -q -O - "$WORLD" > /data/world.zip
|
||||
echo "Unzipping word"
|
||||
unzip -q /data/world.zip
|
||||
rm -f /data/world.zip
|
||||
if [ ! -d /data/world ]; 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
|
||||
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"
|
||||
fi
|
||||
;;
|
||||
*)
|
||||
echo "Invalid URL given for world: Must be HTTP or HTTPS and a ZIP file"
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
|
||||
# If supplied with a URL for a modpack (simple zip of jars), download it and unpack
|
||||
if [[ "$MODPACK" ]]; then
|
||||
case "X$MODPACK" in
|
||||
X[Hh][Tt][Tt][Pp]*[Zz][iI][pP])
|
||||
echo "Downloading mod/plugin pack via HTTP"
|
||||
echo " from $MODPACK ..."
|
||||
curl -sSL -o /tmp/modpack.zip "$MODPACK"
|
||||
if [ "$TYPE" = "SPIGOT" ]; then
|
||||
mkdir -p /data/plugins
|
||||
unzip -o -d /data/plugins /tmp/modpack.zip
|
||||
else
|
||||
mkdir -p /data/mods
|
||||
unzip -o -d /data/mods /tmp/modpack.zip
|
||||
fi
|
||||
rm -f /tmp/modpack.zip
|
||||
;;
|
||||
*)
|
||||
echo "Invalid URL given for modpack: Must be HTTP or HTTPS and a ZIP file"
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
|
||||
function setServerProp {
|
||||
local prop=$1
|
||||
local var=$2
|
||||
if [ -n "$var" ]; then
|
||||
echo "Setting $prop to $var"
|
||||
sed -i "/$prop\s*=/ c $prop=$var" /data/server.properties
|
||||
fi
|
||||
|
||||
}
|
||||
|
||||
if [ ! -e server.properties ]; then
|
||||
echo "Creating server.properties"
|
||||
cp /tmp/server.properties .
|
||||
|
||||
if [ -n "$MOTD" ]; then
|
||||
sed -i "/motd\s*=/ c motd=$MOTD" /data/server.properties
|
||||
if [ -n "$WHITELIST" ]; then
|
||||
echo "Creating whitelist"
|
||||
sed -i "/whitelist\s*=/ c whitelist=true" /data/server.properties
|
||||
sed -i "/white-list\s*=/ c white-list=true" /data/server.properties
|
||||
fi
|
||||
|
||||
if [ -n "$LEVEL" ]; then
|
||||
sed -i "/level-name\s*=/ c level-name=$LEVEL" /data/server.properties
|
||||
fi
|
||||
setServerProp "motd" "$MOTD"
|
||||
setServerProp "allow-nether" "$ALLOW_NETHER"
|
||||
setServerProp "announce-player-achievements" "$ANNOUNCE_PLAYER_ACHIEVEMENTS"
|
||||
setServerProp "enable-command-block" "$ENABLE_COMMAND_BLOCK"
|
||||
setServerProp "spawn-animals" "$SPAWN_ANIMAILS"
|
||||
setServerProp "spawn-monsters" "$SPAWN_MONSTERS"
|
||||
setServerProp "spawn-npcs" "$SPAWN_NPCS"
|
||||
setServerProp "generate-structures" "$GENERATE_STRUCTURES"
|
||||
setServerProp "spawn-npcs" "$SPAWN_NPCS"
|
||||
setServerProp "view-distance" "$VIEW_DISTANCE"
|
||||
setServerProp "hardcore" "$HARDCORE"
|
||||
setServerProp "max-build-height" "$MAX_BUILD_HEIGHT"
|
||||
setServerProp "force-gamemode" "$FORCE_GAMEMODE"
|
||||
setServerProp "hardmax-tick-timecore" "$MAX_TICK_TIME"
|
||||
setServerProp "enable-query" "$ENABLE_QUERY"
|
||||
setServerProp "query.port" "$QUERY_PORT"
|
||||
setServerProp "enable-rcon" "$ENABLE_RCON"
|
||||
setServerProp "rcon.password" "$RCON_PASSWORD"
|
||||
setServerProp "rcon.port" "$RCON_PORT"
|
||||
setServerProp "max-players" "$MAX_PLAYERS"
|
||||
setServerProp "max-world-size" "$MAX_WORLD_SIZE"
|
||||
setServerProp "level-name" "$LEVEL"
|
||||
setServerProp "level-seed" "$SEED"
|
||||
setServerProp "pvp" "$PVP"
|
||||
setServerProp "generator-settings" "$GENERATOR_SETTINGS"
|
||||
setServerProp "online-mode" "$ONLINE_MODE"
|
||||
|
||||
if [ -n "$SEED" ]; then
|
||||
sed -i "/level-seed\s*=/ c level-seed=$SEED" /data/server.properties
|
||||
fi
|
||||
|
||||
if [ -n "$PVP" ]; then
|
||||
sed -i "/pvp\s*=/ c pvp=$PVP" /data/server.properties
|
||||
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)
|
||||
sed -i "/level-type\s*=/ c level-type=$LEVEL_TYPE" /data/server.properties
|
||||
;;
|
||||
*)
|
||||
echo "Invalid LEVEL_TYPE: $LEVEL_TYPE"
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
|
||||
if [ -n "$DIFFICULTY" ]; then
|
||||
case $DIFFICULTY in
|
||||
peaceful)
|
||||
peaceful|0)
|
||||
DIFFICULTY=0
|
||||
;;
|
||||
easy)
|
||||
easy|1)
|
||||
DIFFICULTY=1
|
||||
;;
|
||||
normal)
|
||||
normal|2)
|
||||
DIFFICULTY=2
|
||||
;;
|
||||
hard)
|
||||
hard|3)
|
||||
DIFFICULTY=3
|
||||
;;
|
||||
*)
|
||||
@@ -124,34 +467,49 @@ if [ ! -e server.properties ]; then
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
echo "Setting difficulty to $DIFFICULTY"
|
||||
sed -i "/difficulty\s*=/ c difficulty=$DIFFICULTY" /data/server.properties
|
||||
fi
|
||||
|
||||
if [ -n "$MODE" ]; then
|
||||
case ${MODE,,?} in
|
||||
echo "Setting mode"
|
||||
MODE_LC=$( echo $MODE | tr '[:upper:]' '[:lower:]' )
|
||||
case $MODE_LC in
|
||||
0|1|2|3)
|
||||
;;
|
||||
s*)
|
||||
su*)
|
||||
MODE=0
|
||||
;;
|
||||
c*)
|
||||
MODE=1
|
||||
;;
|
||||
a*)
|
||||
MODE=2
|
||||
;;
|
||||
sp*)
|
||||
MODE=3
|
||||
;;
|
||||
*)
|
||||
echo "ERROR: Invalid game mode: $MODE"
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
sed -i "/gamemode\s*=/ c gamemode=$MODE" /data/server.properties
|
||||
sed -i "/gamemode\s*=/ c gamemode=$MODE" $SERVER_PROPERTIES
|
||||
fi
|
||||
fi
|
||||
|
||||
|
||||
if [ -n "$OPS" -a ! -e ops.txt.converted ]; then
|
||||
echo "Setting ops"
|
||||
echo $OPS | awk -v RS=, '{print}' >> ops.txt
|
||||
fi
|
||||
|
||||
if [ -n "$WHITELIST" -a ! -e white-list.txt.converted ]; then
|
||||
echo "Setting whitelist"
|
||||
echo $WHITELIST | awk -v RS=, '{print}' >> white-list.txt
|
||||
fi
|
||||
|
||||
if [ -n "$ICON" -a ! -e server-icon.png ]; then
|
||||
echo "Using server icon from $ICON..."
|
||||
# Not sure what it is yet...call it "img"
|
||||
@@ -165,4 +523,66 @@ if [ -n "$ICON" -a ! -e server-icon.png ]; then
|
||||
fi
|
||||
fi
|
||||
|
||||
exec java $JVM_OPTS -jar $SERVER
|
||||
# Make sure files exist to avoid errors
|
||||
if [ ! -e banned-players.json ]; then
|
||||
echo '' > banned-players.json
|
||||
fi
|
||||
if [ ! -e banned-ips.json ]; then
|
||||
echo '' > banned-ips.json
|
||||
fi
|
||||
|
||||
# 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
|
||||
[ -d /data/config ] || mkdir /data/config
|
||||
for c in /config/*
|
||||
do
|
||||
if [ -f "$c" ]; then
|
||||
echo Copying configuration `basename "$c"`
|
||||
cp -rf "$c" /data/config
|
||||
fi
|
||||
done
|
||||
|
||||
if [ "$TYPE" = "SPIGOT" ]; then
|
||||
if [ -d /plugins ]; then
|
||||
echo Copying any Bukkit plugins over
|
||||
cp -r /plugins /data
|
||||
fi
|
||||
fi
|
||||
|
||||
EXTRA_ARGS=""
|
||||
# Optional disable console
|
||||
if [[ ${CONSOLE} = false || ${CONSOLE} = FALSE ]]; then
|
||||
EXTRA_ARGS+="--noconsole"
|
||||
fi
|
||||
|
||||
# Optional disable GUI for headless servers
|
||||
if [[ ${GUI} = false || ${GUI} = FALSE ]]; then
|
||||
EXTRA_ARGS="${EXTRA_ARGS} nogui"
|
||||
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}}"
|
||||
JVM_OPTS="-Xms${INIT_MEMORY:-${MEMORY}} -Xmx${MAX_MEMORY:-${MEMORY}} ${JVM_OPTS}"
|
||||
|
||||
if [[ ${TYPE} == "FEED-THE-BEAST" ]]; then
|
||||
cp -f $SERVER_PROPERTIES ${FTB_DIR}/server.properties
|
||||
cp -f /data/{eula,ops,white-list}.txt ${FTB_DIR}/
|
||||
cd ${FTB_DIR}
|
||||
echo "Running FTB server modpack start ..."
|
||||
exec sh ${FTB_SERVER_START}
|
||||
else
|
||||
# If we have a bootstrap.txt file... feed that in to the server stdin
|
||||
if [ -f /data/bootstrap.txt ];
|
||||
then
|
||||
exec java $JVM_XX_OPTS $JVM_OPTS -jar $SERVER "$@" $EXTRA_ARGS < /data/bootstrap.txt
|
||||
else
|
||||
exec java $JVM_XX_OPTS $JVM_OPTS -jar $SERVER "$@" $EXTRA_ARGS
|
||||
fi
|
||||
fi
|
||||
|
||||
@@ -1,8 +1,22 @@
|
||||
#!/bin/sh
|
||||
|
||||
set -e
|
||||
usermod --uid $UID minecraft
|
||||
chown -R minecraft /data /start-minecraft
|
||||
sed -i "/^minecraft/s/:1000:1000:/:${UID}:${GID}:/g" /etc/passwd
|
||||
sed -i "/^minecraft/s/:1000:/:${GID}:/g" /etc/group
|
||||
|
||||
exec sudo -E -u minecraft /start-minecraft
|
||||
if [ "$SKIP_OWNERSHIP_FIX" != "TRUE" ]; then
|
||||
fix_ownership() {
|
||||
dir=$1
|
||||
if ! su-exec minecraft test -w $dir; then
|
||||
echo "Correcting writability of $dir ..."
|
||||
chown -R minecraft:minecraft $dir
|
||||
chmod -R u+w $dir
|
||||
fi
|
||||
}
|
||||
|
||||
fix_ownership /data
|
||||
fix_ownership /home/minecraft
|
||||
fi
|
||||
|
||||
echo "Switching to user 'minecraft'"
|
||||
su-exec minecraft /start-minecraft $@
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
FROM itzg/gvm
|
||||
|
||||
MAINTAINER itzg
|
||||
LABEL maintainer "itzg"
|
||||
|
||||
RUN ["/run", "install", "springboot"]
|
||||
|
||||
|
||||
@@ -1,11 +1,12 @@
|
||||
FROM itzg/ubuntu-openjdk-7
|
||||
FROM openjdk:8-jre
|
||||
|
||||
MAINTAINER itzg
|
||||
LABEL maintainer "itzg"
|
||||
|
||||
ENV TITAN_VERSION 0.5.4
|
||||
|
||||
RUN wget -q -O /tmp/titan.zip http://s3.thinkaurelius.com/downloads/titan/titan-$TITAN_VERSION-hadoop2.zip
|
||||
RUN unzip -q /tmp/titan.zip -d /opt && rm /tmp/titan.zip
|
||||
ADD http://s3.thinkaurelius.com/downloads/titan/titan-$TITAN_VERSION-hadoop2.zip /tmp/titan.zip
|
||||
RUN unzip -q /tmp/titan.zip -d /opt && \
|
||||
rm /tmp/titan.zip
|
||||
|
||||
ENV TITAN_HOME /opt/titan-$TITAN_VERSION-hadoop2
|
||||
WORKDIR $TITAN_HOME
|
||||
|
||||
@@ -17,11 +17,11 @@ the next time you (re)start your container.
|
||||
|
||||
# Connecting to Cassandra and Elasticsearch Containers
|
||||
|
||||
First start containers for Cassandra and Elasticsearch, where the `--name` you choose
|
||||
can be arbitrary or left off to use a generated name.
|
||||
First start containers for Cassandra and Elasticsearch (pre-2.x),
|
||||
where the `--name` you choose can be arbitrary or left off to use a generated name.
|
||||
|
||||
docker run -d --name gremlin-cass itzg/cassandra
|
||||
docker run -d --name gremlin-es itzg/elasticsearch
|
||||
docker run -d --name gremlin-cass itzg/cassandra
|
||||
docker run -d --name gremlin-es itzg/elasticsearch:1.x
|
||||
|
||||
Now start Gremlin with networking links to those containers with the aliases
|
||||
|
||||
@@ -43,3 +43,21 @@ and with that you can follow the
|
||||
==>age=10000
|
||||
gremlin> saturn.in('father').in('father').name
|
||||
==>hercules
|
||||
|
||||
# Running and Connecting with Docker Compose
|
||||
|
||||
Create the following Compose content as the file `docker-compose.yml` and in
|
||||
that directory invoke `docker-compose run titan` to run the Gremlin shell
|
||||
with the supporting Elasticsearch and Cassandra containers.
|
||||
|
||||
```
|
||||
titan:
|
||||
image: itzg/titan-gremlin
|
||||
links:
|
||||
- cass
|
||||
- es
|
||||
cass:
|
||||
image: itzg/cassandra
|
||||
es:
|
||||
image: itzg/elasticsearch:1.x
|
||||
```
|
||||
|
||||
@@ -48,7 +48,7 @@ END
|
||||
index.search.hostname=$esAddr
|
||||
END
|
||||
fi
|
||||
|
||||
|
||||
fi
|
||||
|
||||
if [ -n "$shortcut" ]; then
|
||||
@@ -59,4 +59,6 @@ END
|
||||
args="$args /tmp/init.groovy"
|
||||
fi
|
||||
|
||||
# Allow a little extra time for Cassandra to be ready
|
||||
sleep 1
|
||||
exec $TITAN_HOME/bin/gremlin.sh $args
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
FROM itzg/ubuntu-openjdk-7
|
||||
|
||||
MAINTAINER itzg
|
||||
LABEL maintainer "itzg"
|
||||
|
||||
ENV APT_GET_UPDATE 2014-07-19
|
||||
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
FROM ubuntu:trusty
|
||||
|
||||
MAINTAINER itzg
|
||||
LABEL maintainer "itzg"
|
||||
|
||||
ENV APT_GET_UPDATE 2015-07-16
|
||||
ENV APT_GET_UPDATE 2015-10-29
|
||||
RUN apt-get update
|
||||
RUN DEBIAN_FRONTEND=noninteractive \
|
||||
apt-get -q -y install openjdk-7-jre-headless wget unzip \
|
||||
|
||||
Reference in New Issue
Block a user