Compare commits

...

36 Commits

Author SHA1 Message Date
Geoff Bourne
e3296c3cc0 [es] Upgrade to 5.2.1 2017-02-15 19:30:33 -06:00
Geoff Bourne
f5dbbcc2c6 [mc] Use G1 GC by default and simplify max memory setting
For #126
2017-02-14 22:15:36 -06:00
Geoff Bourne
134eaedf23 Merge pull request #125 from HenryGessau/FTB
Add Feed-The-Beast (FTB) server modpack support
2017-02-13 22:23:33 -06:00
Henry Gessau
4a89f3c579 Add Feed-The-Beast (FTB) server modpack support
The popular mod site https://www.feed-the-beast.com provides server
modpacks to go with their client modpacks. These server modpacks
include a custom start script that must be used to launch the server.
2017-02-13 22:13:53 -05:00
Geoff Bourne
17420ed590 [es] Added HEALTHCHECK 2017-02-04 14:37:45 -06:00
Geoff Bourne
2125fa0855 [es] Tweak spacing on README 2017-02-02 20:53:47 -06:00
Geoff Bourne
5c14c30a78 [es] Include docker stack deploy instructions 2017-02-02 20:48:17 -06:00
Geoff Bourne
788d06c086 [es] Upgrade to 5.2.0
For #124
2017-02-02 20:28:12 -06:00
Geoff Bourne
1a88c96beb Merged branch master into master 2017-02-02 19:31:11 -06:00
Geoff Bourne
b8d69278e4 [es] Fix address binding for Swarm Mode 2017-01-23 10:25:50 -06:00
Geoff Bourne
4a7ecffcbb [es][kibana] Upgrade to 5.1.2 2017-01-15 07:04:27 -06:00
Geoff Bourne
9fe0021a7a [mc] Upgrade base image to openjdk
Fixes #122
2017-01-12 19:40:58 -06:00
Geoff Bourne
262816bd2d [es] Add note about increasing mmap count 2017-01-04 20:43:23 -06:00
Geoff Bourne
e44d27c00a [es] Fine java security grants
Fixes #119
* also switch/upgrade base to openjdk 8u111
2017-01-04 20:37:20 -06:00
Geoff Bourne
5062bc91ab [es] Fixed DISCOVER_HTTP_IP typo in README
Fixes #120
2017-01-04 19:56:33 -06:00
Geoff Bourne
dde4132d2c [cass] Switch mirror URL to pair.com 2017-01-01 13:29:52 -06:00
Geoff Bourne
9bb3628792 [kibana] Upgrade to 5.1.1 2016-12-09 15:23:06 -06:00
Geoff Bourne
03a5bb1ab0 [es] Upgrade to 5.1.1 2016-12-09 15:15:38 -06:00
Geoff Bourne
3a9a1dc043 [es] small command line fix (#117)
small command line fix
2016-12-09 10:55:08 -06:00
Eric Pugh
36ced1c630 small command line fix 2016-12-09 10:45:34 -05:00
Geoff Bourne
0cb0755739 [kibana] Upgrade to 5.0.2 2016-11-30 19:21:16 -06:00
Geoff Bourne
3e8eca6e28 [es] Upgrade to 5.0.2
Fixes #113
2016-11-29 22:05:13 -06:00
Geoff Bourne
a179f5f7ba [cass] Upgrade to 2.2.8 2016-11-29 19:14:05 -06:00
Geoff Bourne
f2955bcc2f [es] Bump to 5.0.1
* explicitly configure default JVM heap size
* /conf needed ownership fixed
For #112
2016-11-28 20:37:44 -07:00
Geoff Bourne
a0c1ed88d1 [kibana] Adjust binding hosting from old default 2016-11-13 15:18:37 -06:00
Geoff Bourne
de6d7a64ac Merge branch 'master' of github.com:itzg/dockerfiles 2016-11-13 14:59:47 -06:00
Geoff Bourne
3bf560bfbe [kibana] Upgrade to 5.0.0
* also switched to openjdk 8 base image
2016-11-13 14:59:22 -06:00
Geoff Bourne
f1b58323d3 [es] Fixed TYPE usage
Removed last of the --'s parameters
2016-11-05 10:46:32 -05:00
Geoff Bourne
d4a888073b [es] Upgrade to 5.0.0 2016-11-04 20:18:43 -05:00
Geoff Bourne
54844930bb [jenkins] Working around hub build issue 2016-10-23 09:52:25 -05:00
Geoff Bourne
b26714c9c1 [jenkins] Move COPY later in build 2016-10-23 09:36:16 -05:00
Geoff Bourne
f03a8f0edc [jenkins] Switch local ADD to COPY 2016-10-23 09:29:46 -05:00
Geoff Bourne
048beefadc [jenkins] Pre-installing graphviz (for dependency graphs, etc) 2016-10-23 00:35:02 -05:00
Geoff Bourne
de3545e8d9 Merge pull request #109 from manuelgu/patch-1
Fix formatting in minecraft README
2016-10-18 13:54:57 -05:00
manuelgu
e766301d1e Fix formatting 2016-10-18 13:59:43 +02:00
Geoff Bourne
3348083424 [mc] Fix game mode shorthand handling of s*
For #107
2016-10-02 07:50:19 -05:00
14 changed files with 467 additions and 133 deletions

View File

@@ -2,9 +2,9 @@ FROM java:openjdk-8u72-jdk
MAINTAINER itzg
ENV CASSANDRA_VERSION 2.2.7
ENV CASSANDRA_VERSION 2.2.8
RUN wget -qO /tmp/apache-cassandra.tgz http://mirrors.ibiblio.org/apache/cassandra/$CASSANDRA_VERSION/apache-cassandra-$CASSANDRA_VERSION-bin.tar.gz
ADD http://apache.mirrors.pair.com/cassandra/$CASSANDRA_VERSION/apache-cassandra-$CASSANDRA_VERSION-bin.tar.gz /tmp/apache-cassandra.tgz
RUN tar -C /opt -zxf /tmp/apache-cassandra.tgz && \
rm /tmp/apache-cassandra.tgz

View File

@@ -1,21 +1,23 @@
FROM java:8u92-jre-alpine
FROM openjdk:8u111-jre-alpine
MAINTAINER itzg
ENV ES_VERSION=2.4.1
RUN apk -U add bash
ADD https://download.elasticsearch.org/elasticsearch/release/org/elasticsearch/distribution/tar/elasticsearch/$ES_VERSION/elasticsearch-$ES_VERSION.tar.gz /tmp/es.tgz
ENV ES_VERSION=5.2.1
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
COPY start /start
EXPOSE 9200 9300
HEALTHCHECK --timeout=5s CMD wget -q -O - http://$HOSTNAME:9200/_cat/health
ENV ES_HOME=/usr/share/elasticsearch-$ES_VERSION \
OPTS=-Dnetwork.host=_non_loopback_ \
DEFAULT_ES_USER=elasticsearch
DEFAULT_ES_USER=elasticsearch \
ES_JAVA_OPTS="-Xms1g -Xmx1g"
RUN adduser -S -s /bin/sh $DEFAULT_ES_USER
@@ -23,4 +25,8 @@ 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"]

View File

@@ -1,5 +1,10 @@
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:
@@ -29,9 +34,9 @@ Where `DOCKERHOST` would be the actual hostname of your host running Docker.
To run a multi-node cluster (3-node in this example) on a single Docker machine use:
docker run -d --name es0 -p 9200:9200 es
docker run -d --name es1 --link es0 -e UNICAST_HOSTS=es0 es
docker run -d --name es2 --link es0 -e UNICAST_HOSTS=es0 es
docker run -d --name es0 -p 9200:9200 itzg/elasticsearch
docker run -d --name es1 --link es0 -e UNICAST_HOSTS=es0 itzg/elasticsearch
docker run -d --name es2 --link es0 -e UNICAST_HOSTS=es0 itzg/elasticsearch
and then check the cluster health, such as http://192.168.99.100:9200/_cluster/health?pretty
@@ -49,6 +54,40 @@ and then check the cluster health, such as http://192.168.99.100:9200/_cluster/h
"unassigned_shards" : 0
}
If you have a Docker Swarm cluster already initialized you can download this
[docker-compose.yml](https://raw.githubusercontent.com/itzg/dockerfiles/master/elasticsearch/docker-compose.yml) and deploy a cluster using:
docker stack deploy -c docker-compose.yml es
With a `docker service ls` you can confirm 1 master, 2 data, and 1 gateway nodes are running:
```
ID NAME MODE REPLICAS IMAGE
9nwnno8hbqgk es_kibana replicated 1/1 kibana:latest
f5x7nipwmvkr es_gateway replicated 1/1 es
om8rly2yxylw es_data replicated 2/2 es
tdvfilj370yn es_master replicated 1/1 es
```
As you can see, there is also a Kibana instance included and available at port 5601.
# Health Checks
This container declares a [HEALTHCHECK](https://docs.docker.com/engine/reference/builder/#/healthcheck) that queries the `_cat/health`
endpoint for a quick, one-line gauge of health every 30 seconds.
The current health of the container is shown in the `STATUS` column of `docker ps`, such as
Up 14 minutes (healthy)
You can also check the history of health checks from `inspect`, such as:
```
> docker inspect -f "{{json .State.Health}}" es
{"Status":"healthy","FailingStreak":0,"Log":[...
```
# Configuration Summary
## Ports
@@ -182,18 +221,28 @@ Using the Docker Compose file above, a value of `2` is appropriate when scaling
docker-compose scale master=3
## Auto transport/http discovery with Swarm Mode
## Multiple Network Binding, such as Swarm Mode
When using Docker Swarm mode (starting with 1.12), the overlay and ingress network interfaces are assigned
multiple IP addresses. As a result, it creates confusion for the transport publish logic even when using
the special value `_eth0_`.
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`.
To resolve this, add
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
replacing `eth0` with another interface within the container, if needed.
## Heap size and other JVM options
The same can be done for publish/binding of the http module by adding:
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.
-e DISCOVERY_HTTP_IP=eth2
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.

View File

@@ -0,0 +1,37 @@
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
kibana:
image: kibana
ports:
- "5601:5601"
environment:
ELASTICSEARCH_URL: http://gateway:9200

View 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";
};

View 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

View File

@@ -1,5 +1,103 @@
#!/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() {
ips=`ipaddr show scope global|awk '$1 == "inet" { if (!match($2,"/32")) { gsub("/.*","",$2) ; addrs[length(addrs)] = $2 } } END { for (i in addrs) { if (i>0) printf "," ; printf addrs[i] } }'`
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"
;;
GATEWAY)
OPTS="$OPTS -E node.master=false -E node.data=false"
;;
DATA|NON_MASTER)
OPTS="$OPTS -E node.master=false -E node.data=true"
;;
*)
echo "Unknown node type. Please use MASTER|GATEWAY|DATA|NON_MASTER"
exit 1
esac
fi
}
pre_checks
if [ -f /conf/env ]; then
. /conf/env
fi
@@ -8,95 +106,28 @@ 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="$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"
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 -Des.$mode.host=$ip"
}
if [ "$DISCOVER_TRANSPORT_IP" != "" ]; then
discoverAllGlobalIps
if [ "${DISCOVER_TRANSPORT_IP}" != "" ]; then
discoverIpFromLink $DISCOVER_TRANSPORT_IP transport
fi
if [ "$DISCOVER_HTTP_IP" != "" ]; then
if [ "${DISCOVER_HTTP_IP}" != "" ]; then
discoverIpFromLink $DISCOVER_HTTP_IP http
fi
if [ -n "$CLUSTER" ]; then
OPTS="$OPTS -Des.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 -Des.node.name=$NODE_NAME"
fi
if [ -n "$MULTICAST" ]; then
OPTS="$OPTS -Des.discovery.zen.ping.multicast.enabled=$MULTICAST"
fi
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 "$TYPE" ]; then
case $TYPE in
MASTER)
OPTS="$OPTS --node.master=true --node.data=false"
;;
GATEWAY)
OPTS="$OPTS --node.master=false --node.data=false"
;;
DATA|NON_MASTER)
OPTS="$OPTS --node.master=false --node.data=true"
;;
*)
echo "Unknown node type. Please use MASTER|GATEWAY|DATA|NON_MASTER"
exit 1
esac
fi
if [ -n "$MIN_MASTERS" ]; then
OPTS="$OPTS --discovery.zen.minimum_master_nodes=$MIN_MASTERS"
fi
mkdir -p /conf/plugins
OPTS="$OPTS --path.plugins=/conf/plugins"
if [ -n "$PLUGINS" ]; then
PLUGIN_OPTS="-Des.path.conf=/conf -Des.path.plugins=/conf/plugins"
for p in $(echo $PLUGINS | awk -v RS=, '{print}')
do
echo "Installing the plugin $p"
$ES_HOME/bin/plugin $PLUGIN_OPTS install $p -t 1m -b
done
else
mkdir -p /conf/plugins
fi
setup_personality
setup_clustering
install_plugins
mkdir -p /conf/scripts
@@ -104,8 +135,7 @@ echo "Starting Elasticsearch with the options $OPTS"
CMD="$ES_HOME/bin/elasticsearch $OPTS"
if [ `id -u` = 0 ]; then
echo "Running as non-root..."
chown -R $DEFAULT_ES_USER /data
set -x
chown -R $DEFAULT_ES_USER /data /conf
su -c "$CMD" $DEFAULT_ES_USER
else
$CMD

View File

@@ -1,12 +1,17 @@
FROM java:openjdk-8u72-jdk
FROM java:openjdk-8u102-jdk
MAINTAINER itzg
ADD download-and-start.sh /download-and-start
RUN apt-get update && \
DEBIAN_FRONTEND=noninteractive apt-get install -y \
graphviz \
&& apt-get clean
ENV JENKINS_HOME=/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"]

View File

@@ -1,13 +1,14 @@
FROM itzg/ubuntu-openjdk-7
FROM openjdk:8u111-jre
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

View File

@@ -0,0 +1,12 @@
version: '2'
services:
es:
build: ../elasticsearch
ports:
- "9200:9200"
kibana:
build: .
ports:
- "5601:5601"

View File

@@ -1,6 +1,5 @@
#!/bin/bash
#!/bin/sh
OPTS="-e $ES_URL"
OPTS="-e $ES_URL -H $HOSTNAME"
exec bin/kibana $OPTS

View File

@@ -1,4 +1,4 @@
FROM java:8
FROM openjdk:8-jre
MAINTAINER itzg
@@ -38,6 +38,6 @@ ENTRYPOINT [ "/start" ]
ENV UID=1000 GID=1000 \
MOTD="A Minecraft Server Powered by Docker" \
JVM_OPTS="-Xmx1024M -Xms1024M" \
JVM_XX_OPTS="-XX:+UseG1GC" MAX_MEMORY="1G" \
TYPE=VANILLA VERSION=LATEST FORGEVERSION=RECOMMENDED LEVEL=world PVP=true DIFFICULTY=easy \
LEVEL_TYPE=DEFAULT GENERATOR_SETTINGS= WORLD= MODPACK= ONLINE_MODE=TRUE CONSOLE=true

View File

@@ -264,6 +264,65 @@ 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
### 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
@@ -377,18 +436,20 @@ Enables command blocks
### 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
* 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
* 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
@@ -547,10 +608,11 @@ By default, server checks connecting players against Minecraft's account databas
### 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 memory limit of 1 GB. That can be adjusted
higher (or lower) by setting the `MAX_MEMORY` environment variable. For example,
the following increases the memory limit to 8 GB:
docker run -e 'JVM_OPTS=-Xmx1024M -Xms1024M' ...
docker run -e MAX_MEMORY=8G ...
### /data ownership

View File

@@ -157,6 +157,44 @@ function installForge {
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 [[ ${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} ..."
local ftb_dir=/data/FeedTheBeast
mkdir -p ${ftb_dir}
unzip -u -o ${srv_modpack} -d ${ftb_dir}
cp -f /data/eula.txt ${ftb_dir}/eula.txt
FTB_SERVER_START=${ftb_dir}/ServerStart.sh
chmod a+x ${FTB_SERVER_START}
}
function installVanilla {
SERVER="minecraft_server.$VANILLA_VERSION.jar"
@@ -197,12 +235,17 @@ case "$TYPE" in
# normalize on Spigot for operations below
TYPE=SPIGOT
;;
FORGE|forge)
TYPE=FORGE
installForge
;;
FTB|ftb)
TYPE=FEED-THE-BEAST
installFTB
;;
VANILLA|vanilla)
installVanilla
;;
@@ -362,7 +405,7 @@ if [ ! -e server.properties ]; then
case ${MODE,,?} in
0|1|2|3)
;;
s*)
su*)
MODE=0
;;
c*)
@@ -371,7 +414,7 @@ if [ ! -e server.properties ]; then
a*)
MODE=2
;;
s*)
sp*)
MODE=3
;;
*)
@@ -447,10 +490,20 @@ else
EXTRA_ARGS=""
fi
# If we have a bootstrap.txt file... feed that in to the server stdin
if [ -f /data/bootstrap.txt ];
then
exec java $JVM_OPTS -jar $SERVER "$@" $EXTRA_ARGS < /data/bootstrap.txt
else
exec java $JVM_OPTS -jar $SERVER "$@" $EXTRA_ARGS
if [[ ! -z $MAX_MEMORY ]]; then
# put prior JVM_OPTS at the end to give any memory settings there higher precedence
JVM_OPTS="-Xms${MAX_MEMORY} -Xmx${MAX_MEMORY} ${JVM_OPTS}"
fi
set -x
if [[ ${TYPE} == "FEED-THE-BEAST" ]]; then
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