mirror of
https://github.com/itzg/docker-minecraft-server.git
synced 2026-02-17 07:03:57 +00:00
Compare commits
33 Commits
7u55
...
minecraft-
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
6396e58d3c | ||
|
|
4de10e1ba8 | ||
|
|
1a364ae733 | ||
|
|
9ffa2daeaa | ||
|
|
8973e7dc7b | ||
|
|
3c8db58c7e | ||
|
|
ee9f27546b | ||
|
|
8a2199a890 | ||
|
|
b4be1b37bd | ||
|
|
d590bc62c1 | ||
|
|
9349ca6d04 | ||
|
|
9e845521a9 | ||
|
|
5557f91c79 | ||
|
|
c324403f95 | ||
|
|
9fe8d6cca6 | ||
|
|
55cffbb598 | ||
|
|
4ff077f151 | ||
|
|
5566cf0953 | ||
|
|
5d3845a9ba | ||
|
|
b952ee6fdd | ||
|
|
8035aa5f69 | ||
|
|
84521eca53 | ||
|
|
77541a9689 | ||
|
|
716ff66b1b | ||
|
|
029e7d8974 | ||
|
|
7d8429ef0a | ||
|
|
df155ee51c | ||
|
|
f85240898d | ||
|
|
84154c3d64 | ||
|
|
6163e080cd | ||
|
|
7fb406c2bb | ||
|
|
8168c62bdd | ||
|
|
972036feb4 |
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
@@ -0,0 +1 @@
|
||||
.idea/
|
||||
29
devbox/Dockerfile
Normal file
29
devbox/Dockerfile
Normal file
@@ -0,0 +1,29 @@
|
||||
FROM itzg/ubuntu-openjdk-7
|
||||
|
||||
RUN apt-get update
|
||||
RUN apt-get install -yq git curl wget unzip openjdk-7-jdk
|
||||
|
||||
ENV MAVEN_VER 3.2.2
|
||||
ENV NODEJS_VER 0.10.29
|
||||
|
||||
WORKDIR /opt
|
||||
|
||||
RUN wget -O /tmp/maven.tgz http://apache.mirrors.pair.com/maven/maven-3/$MAVEN_VER/binaries/apache-maven-$MAVEN_VER-bin.tar.gz
|
||||
RUN tar xvf /tmp/maven.tgz && rm /tmp/maven.tgz
|
||||
ENV M2_HOME /opt/apache-maven-$MAVEN_VER
|
||||
ENV PATH $PATH:$M2_HOME/bin
|
||||
|
||||
RUN curl -s https://raw.githubusercontent.com/isaacs/nave/master/nave.sh > /usr/local/bin/nave
|
||||
RUN chmod +x /usr/local/bin/nave
|
||||
RUN nave usemain latest
|
||||
|
||||
WORKDIR /root
|
||||
env HOME /root
|
||||
|
||||
VOLUME ["/shared"]
|
||||
|
||||
RUN curl -s get.gvmtool.net | bash
|
||||
|
||||
RUN apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
|
||||
|
||||
CMD bash
|
||||
25
devbox/README.md
Normal file
25
devbox/README.md
Normal file
@@ -0,0 +1,25 @@
|
||||
Provides a development/build environment for Java, Groovy, and NodeJS.
|
||||
|
||||
* Provides 'gvm' for Groovy (and more) installation management
|
||||
* Provides 'nave' for NodeJS installation management
|
||||
* Pre-installs the latest NodeJS via nave
|
||||
|
||||
## Using the persistent/shared workarea
|
||||
|
||||
Since devbox containers are intended to be disposable, the image is configured
|
||||
with a "volume" at `/shared`.
|
||||
|
||||
There are a couple of ways you can leverage that volume. Either attach it to
|
||||
a host-local directory:
|
||||
|
||||
docker run -it -v $(pwd)/workarea:/shared --rm itzg/devbox
|
||||
|
||||
or run a "base" container and mounts the `/shared` from that onto any
|
||||
subsequent containers:
|
||||
|
||||
docker run --name devbox-base itzg/devbox touch /shared/READY
|
||||
...later...
|
||||
docker run -it --volumes-from devbox-base --rm itzg/devbox
|
||||
|
||||
**NOTE** I am using the `--rm` option so the devbox containers will be truly
|
||||
"burn after use".
|
||||
@@ -1,5 +0,0 @@
|
||||
FROM dockerfile/elasticsearch
|
||||
|
||||
MAINTAINER itzg
|
||||
|
||||
RUN /elasticsearch/bin/plugin -i elasticsearch/marvel/latest
|
||||
@@ -1,11 +1,5 @@
|
||||
This image extends the official elasticsearch image by adding the Marvel Sense plugin. This will get you a system ready to use with the [ElasticSearch Getting Started Guide](http://www.elasticsearch.org/guide/en/elasticsearch/guide/current).
|
||||
**This image is now deprecated. **
|
||||
|
||||
Start the container with a command-line such as
|
||||
|
||||
docker run -d --name es -p 9200:9200 -p 9300:9300 itzg/elasticsearch-marvel
|
||||
|
||||
and now with Marvel Sense installed you can access it using a URL like:
|
||||
|
||||
http://192.168.59.103:9200/_plugin/marvel/sense/index.html
|
||||
|
||||
(replacing the IP address shown here with your Docker host's)
|
||||
Please use [itzg/elasticsearch](https://registry.hub.docker.com/u/itzg/elasticsearch/)
|
||||
instead. See the plugins configuration section for that image to see how
|
||||
to install Marvel.
|
||||
|
||||
27
elasticsearch/Dockerfile
Normal file
27
elasticsearch/Dockerfile
Normal file
@@ -0,0 +1,27 @@
|
||||
FROM itzg/ubuntu-openjdk-7
|
||||
|
||||
MAINTAINER itzg
|
||||
RUN apt-get install -y wget && apt-get clean
|
||||
|
||||
ENV ES_VERSION 1.4.1
|
||||
|
||||
RUN wget -qO /tmp/es.tgz https://download.elasticsearch.org/elasticsearch/elasticsearch/elasticsearch-$ES_VERSION.tar.gz && \
|
||||
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
|
||||
|
||||
CMD ["/start"]
|
||||
120
elasticsearch/README.md
Normal file
120
elasticsearch/README.md
Normal file
@@ -0,0 +1,120 @@
|
||||
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.
|
||||
|
||||
# Basic Usage
|
||||
|
||||
To start an Elasticsearch data node that listens on the standard ports on
|
||||
your host's network interface:
|
||||
|
||||
docker run -d -p 9200:9200 -p 9300:9300 itzg/elasticsearch
|
||||
|
||||
You'll then be able to connect to the Elasticsearch HTTP interface to confirm
|
||||
it's alive:
|
||||
|
||||
http://DOCKERHOST:9200/
|
||||
|
||||
{
|
||||
"status" : 200,
|
||||
"name" : "Charon",
|
||||
"version" : {
|
||||
"number" : "1.3.5",
|
||||
"build_hash" : "4a50e7df768fddd572f48830ae9c35e4ded86ac1",
|
||||
"build_timestamp" : "2014-11-05T15:21:28Z",
|
||||
"build_snapshot" : false,
|
||||
"lucene_version" : "4.9"
|
||||
},
|
||||
"tagline" : "You Know, for Search"
|
||||
}
|
||||
|
||||
Where `DOCKERHOST` would be the actual hostname of your host running
|
||||
Docker.
|
||||
|
||||
# Basic multi-node cluster
|
||||
|
||||
Running a multi-node cluster (3-node in this example) is almost as easy:
|
||||
|
||||
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
|
||||
|
||||
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
|
||||
|
||||
{
|
||||
"cluster_name" : "elasticsearch",
|
||||
"status" : "green",
|
||||
"timed_out" : false,
|
||||
"number_of_nodes" : 3,
|
||||
"number_of_data_nodes" : 3,
|
||||
"active_primary_shards" : 0,
|
||||
"active_shards" : 0,
|
||||
"relocating_shards" : 0,
|
||||
"initializing_shards" : 0,
|
||||
"unassigned_shards" : 0
|
||||
}
|
||||
|
||||
# Configuration
|
||||
|
||||
The following configuration options are specified using `docker run`
|
||||
environment variables (`-e`) like
|
||||
|
||||
docker run ... -e NAME=VALUE ... itzg/elasticsearch
|
||||
|
||||
## Cluster Name
|
||||
|
||||
If joining a pre-existing cluster, then you may need to specify a cluster name
|
||||
different than the default "elasticsearch":
|
||||
|
||||
-e CLUSTER=dockers
|
||||
|
||||
## Zen Unicast Hosts
|
||||
|
||||
When joining a multi-physical-host cluster, multicast may not be supported
|
||||
on the physical network. In that case, your node can reference specific one or more hosts in
|
||||
the cluster via the
|
||||
[Zen Unicast Hosts](http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/modules-discovery-zen.html#unicast) capability as a comma-separated list of `HOST:PORT` pairs:
|
||||
|
||||
-e UNICAST_HOSTS=HOST:PORT[,HOST:PORT]
|
||||
|
||||
such as
|
||||
|
||||
-e UNICAST_HOSTS=192.168.0.100:9300
|
||||
|
||||
## Plugins
|
||||
|
||||
You can install one or more plugins before startup by passing a comma-separated
|
||||
list of plugins.
|
||||
|
||||
-e PLUGINS=ID[,ID]
|
||||
|
||||
In this example, it will install the Marvel plugin
|
||||
|
||||
-e PLUGINS=elasticsearch/marvel/latest
|
||||
|
||||
Many more plugins [are available here](http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/modules-plugins.html#known-plugins).
|
||||
|
||||
## Publish As
|
||||
|
||||
Since the container gives the Elasticsearch software an isolated perspective
|
||||
of its networking, it will most likely advertise its published address with
|
||||
a container-internal IP address. This can be overridden with a physical networking
|
||||
name and port using:
|
||||
|
||||
-e PUBLISH_AS=DOCKERHOST:9301
|
||||
|
||||
_Author Note: I have yet to hit a case where this was actually necessary. Other
|
||||
than the cosmetic weirdness in the logs, Elasticsearch seems to be quite tolerant._
|
||||
|
||||
## Node Name
|
||||
|
||||
Rather than use the randomly assigned node name, you can indicate a specific
|
||||
one using:
|
||||
|
||||
-e NODE_NAME=Docker
|
||||
43
elasticsearch/start
Executable file
43
elasticsearch/start
Executable file
@@ -0,0 +1,43 @@
|
||||
#!/bin/sh
|
||||
|
||||
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
|
||||
fi
|
||||
|
||||
OPTS="-Des.path.conf=/conf \
|
||||
-Des.path.data=/data \
|
||||
-Des.path.logs=/data \
|
||||
-Des.transport.tcp.port=9300 \
|
||||
-Des.http.port=9200"
|
||||
|
||||
if [ -n "$CLUSTER" ]; then
|
||||
OPTS="$OPTS -Des.cluster.name=$CLUSTER"
|
||||
fi
|
||||
|
||||
if [ -n "$NODE_NAME" ]; then
|
||||
OPTS="$OPTS -Des.node.name=$NODE_NAME"
|
||||
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 "$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
|
||||
|
||||
echo "Starting Elasticsearch with the options $OPTS"
|
||||
$ES_HOME/bin/elasticsearch $OPTS
|
||||
30
gitblit/Dockerfile
Normal file
30
gitblit/Dockerfile
Normal file
@@ -0,0 +1,30 @@
|
||||
FROM itzg/ubuntu-openjdk-7
|
||||
|
||||
MAINTAINER itzg
|
||||
|
||||
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
|
||||
|
||||
EXPOSE 80 443
|
||||
|
||||
CMD ["/start"]
|
||||
5
gitblit/README.md
Normal file
5
gitblit/README.md
Normal file
@@ -0,0 +1,5 @@
|
||||
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:
|
||||
|
||||
docker run -d -p 80:80 p 443:443 -v /tmp/gitblit-data:/data --name gitblit itzg/gitblit
|
||||
|
||||
10
gitblit/start.sh
Executable file
10
gitblit/start.sh
Executable file
@@ -0,0 +1,10 @@
|
||||
#!/bin/sh
|
||||
|
||||
contents=`ls $GITBLIT_BASE_FOLDER|wc -l`
|
||||
|
||||
if [ $contents = "0" ]; then
|
||||
cp -r $GITBLIT_PATH/data/* $GITBLIT_BASE_FOLDER
|
||||
fi
|
||||
|
||||
$JAVA_HOME/bin/java -jar $GITBLIT_PATH/gitblit.jar --httpsPort $GITBLIT_HTTPS_PORT --httpPort $GITBLIT_HTTP_PORT --baseFolder $GITBLIT_BASE_FOLDER
|
||||
|
||||
@@ -2,10 +2,12 @@ FROM ubuntu:trusty
|
||||
|
||||
MAINTAINER itzg
|
||||
|
||||
ENV APT_GET_UPDATE 2014-09-18
|
||||
|
||||
RUN apt-get update
|
||||
RUN apt-get -y upgrade
|
||||
|
||||
RUN apt-get -y install ruby ruby-dev make patch
|
||||
RUN apt-get -y install ruby ruby-dev make patch nodejs
|
||||
RUN gem install bundler
|
||||
|
||||
ADD Gemfile /tmp/Gemfile
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
highlighter: pygments
|
||||
|
||||
1
minecraft-server/.gitignore
vendored
Normal file
1
minecraft-server/.gitignore
vendored
Normal file
@@ -0,0 +1 @@
|
||||
/data/
|
||||
@@ -2,24 +2,28 @@ FROM itzg/ubuntu-openjdk-7
|
||||
|
||||
MAINTAINER itzg
|
||||
|
||||
RUN apt-get update
|
||||
RUN apt-get install -y wget libmozjs-24-bin
|
||||
RUN apt-get install -y wget libmozjs-24-bin imagemagick && apt-get clean
|
||||
RUN update-alternatives --install /usr/bin/js js /usr/bin/js24 100
|
||||
|
||||
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 minecraft \
|
||||
&& mkdir /data \
|
||||
&& chown minecraft:minecraft /data
|
||||
|
||||
EXPOSE 25565
|
||||
|
||||
ADD start.sh /start
|
||||
ADD start-minecraft.sh /start-minecraft
|
||||
|
||||
USER minecraft
|
||||
VOLUME ['/data']
|
||||
ADD server.properties /tmp/server.properties
|
||||
WORKDIR /data
|
||||
|
||||
CMD /start
|
||||
CMD [ "/start-minecraft" ]
|
||||
|
||||
ENV MOTD A Minecraft Server Powered by Docker
|
||||
ENV LEVEL world
|
||||
ENV JVM_OPTS -Xmx512M -Xms512M
|
||||
ENV VERSION 1.7.9
|
||||
ENV JVM_OPTS -Xmx1024M -Xms1024M
|
||||
ENV VERSION 1.8.1
|
||||
|
||||
@@ -1,29 +1,93 @@
|
||||
This docker image provides a Minecraft Server that will automatically download the latest stable, latest snapshot, or any specific server version.
|
||||
This docker image provides a Minecraft Server that will automatically download the latest stable,
|
||||
latest snapshot, or any specific version.
|
||||
|
||||
To simply use the latest stable version, run
|
||||
|
||||
docker run -d -p 25565:25565 minecraft-server
|
||||
|
||||
where the default server port, 25565, will be exposed on your host machine.
|
||||
docker run -d -p 25565:25565 itzg/minecraft-server
|
||||
|
||||
In order to persist the Minecraft data, which you *probably want to do for a real server setup*, use the `-v` argument to map a local path to the `/data' path in the container, such as
|
||||
where the default server port, 25565, will be exposed on your host machine. If you want to serve up multiple
|
||||
Minecraft servers or just use an alternate port, change the host-side port mapping such as
|
||||
|
||||
docker run -d -v /path/on/host:/data -p 25565:25565 minecraft-server
|
||||
docker run -p 25566:25565 ...
|
||||
|
||||
will serve your Minecraft server on your host's port 25566 since the `-p` syntax is
|
||||
`host-port`:`container-port`.
|
||||
|
||||
Speaking of multiple servers, it's handy to give your containers explicit names using `--name`, such as
|
||||
|
||||
docker run -d -p 25565:25565 --name minecraft-default itzg/minecraft-server
|
||||
|
||||
With that you can easily view the logs, stop, or re-start the container:
|
||||
|
||||
docker logs -f minecraft-default
|
||||
( Ctrl-C to exit logs action )
|
||||
|
||||
docker stop minecraft-default
|
||||
|
||||
docker start minecraft-default
|
||||
|
||||
## EULA Support
|
||||
|
||||
Mojang now requires accepting the [Minecraft EULA](https://account.mojang.com/documents/minecraft_eula). To accept add
|
||||
|
||||
-e EULA=TRUE
|
||||
|
||||
such as
|
||||
|
||||
docker run -e EULA=TRUE -d -p 25565:25565 itzg/minecraft-server
|
||||
|
||||
## Attaching data directory to host filesystem
|
||||
|
||||
In order to persist the Minecraft data, which you *probably want to do for a real server setup*, use the `-v` argument
|
||||
to map a directory on your host machine to the container's `/data` directory, such as:
|
||||
|
||||
docker run -d -v /path/on/host:/data ...
|
||||
|
||||
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.
|
||||
|
||||
## Versions
|
||||
|
||||
To use a different Minecraft version, pass the `VERSION` environment variable, which can have the value
|
||||
|
||||
* LATEST
|
||||
* SNAPSHOT
|
||||
* (or a specific version, such as "1.7.9")
|
||||
|
||||
For example, to use the latest snapshot:
|
||||
|
||||
docker run -d -e VERSION=SNAPSHOT -p 25565:25565 minecraft-server
|
||||
|
||||
docker run -d -e VERSION=SNAPSHOT ...
|
||||
|
||||
or a specific version:
|
||||
|
||||
docker run -d -e VERSION=1.7.9 -p 25565:25565 minecraft-server
|
||||
|
||||
docker run -d -e VERSION=1.7.9 ...
|
||||
|
||||
## Server configuration
|
||||
|
||||
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 ...
|
||||
|
||||
**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.
|
||||
|
||||
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' -p 25565:25565 minecraft-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._
|
||||
|
||||
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
|
||||
|
||||
docker run -d -e OPS=user1,user2 ...
|
||||
|
||||
A server icon can be configured using the `ICON` variable. The image will be automatically
|
||||
downloaded, scaled, and converted from any other image format:
|
||||
|
||||
docker run -d -e ICON=http://..../some/image.png
|
||||
|
||||
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):
|
||||
|
||||
docker run -e 'JVM_OPTS=-Xmx1024M -Xms1024M' ...
|
||||
|
||||
@@ -29,5 +29,5 @@ spawn-monsters=true
|
||||
generate-structures=true
|
||||
view-distance=10
|
||||
spawn-protection=16
|
||||
motd=A Minecraft Server
|
||||
motd=A Minecraft Server powered by Docker
|
||||
|
||||
|
||||
61
minecraft-server/start-minecraft.sh
Executable file
61
minecraft-server/start-minecraft.sh
Executable file
@@ -0,0 +1,61 @@
|
||||
#!/bin/sh
|
||||
|
||||
case $VERSION in
|
||||
LATEST)
|
||||
export VERSION=`wget -O - https://s3.amazonaws.com/Minecraft.Download/versions/versions.json | jsawk -n 'out(this.latest.release)'`
|
||||
;;
|
||||
|
||||
SNAPSHOT)
|
||||
export VERSION=`wget -O - https://s3.amazonaws.com/Minecraft.Download/versions/versions.json | jsawk -n 'out(this.latest.snapshot)'`
|
||||
;;
|
||||
esac
|
||||
|
||||
cd /data
|
||||
|
||||
if [ ! -e minecraft_server.$VERSION.jar ]; then
|
||||
echo "Downloading minecraft_server.$VERSION.jar ..."
|
||||
wget -q https://s3.amazonaws.com/Minecraft.Download/versions/$VERSION/minecraft_server.$VERSION.jar
|
||||
fi
|
||||
|
||||
if [ ! -e server.properties ]; then
|
||||
cp /tmp/server.properties .
|
||||
fi
|
||||
|
||||
if [ -n "$MOTD" ]; then
|
||||
sed -i "/motd\s*=/ c motd=$MOTD" /data/server.properties
|
||||
fi
|
||||
if [ -n "$LEVEL" ]; then
|
||||
sed -i "/level-name\s*=/ c level-name=$LEVEL" /data/server.properties
|
||||
fi
|
||||
if [ -n "$OPS" ]; then
|
||||
echo $OPS | awk -v RS=, '{print}' >> ops.txt
|
||||
fi
|
||||
if [ -n "$ICON" ]; then
|
||||
echo "Using server icon from $ICON..."
|
||||
# Not sure what it is yet...call it "img"
|
||||
wget -q -O /tmp/icon.img $ICON
|
||||
specs=$(identify /tmp/icon.img | awk '{print $2,$3}')
|
||||
if [ "$specs" = "PNG 64x64" ]; then
|
||||
mv /tmp/icon.img /data/server-icon.png
|
||||
else
|
||||
echo "Converting image to 64x64 PNG..."
|
||||
convert /tmp/icon.img -resize 64x64! /data/server-icon.png
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ ! -e /data/eula.txt ]; then
|
||||
if [ "$EULA" != "" ]; then
|
||||
echo "# Generated via Docker on $(date)" > eula.txt
|
||||
echo "eula=$EULA" >> eula.txt
|
||||
else
|
||||
echo ""
|
||||
echo "Please accept the Minecraft EULA at"
|
||||
echo " https://account.mojang.com/documents/minecraft_eula"
|
||||
echo "by adding the following immediately after 'docker run':"
|
||||
echo " -e EULA=TRUE"
|
||||
echo ""
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
java $JVM_OPTS -jar minecraft_server.$VERSION.jar
|
||||
@@ -1,26 +1,4 @@
|
||||
#!/bin/sh
|
||||
|
||||
case $VERSION in
|
||||
LATEST)
|
||||
export VERSION=`wget -O - https://s3.amazonaws.com/Minecraft.Download/versions/versions.json | jsawk -n 'out(this.latest.release)'`
|
||||
;;
|
||||
|
||||
SNAPSHOT)
|
||||
export VERSION=`wget -O - https://s3.amazonaws.com/Minecraft.Download/versions/versions.json | jsawk -n 'out(this.latest.snapshot)'`
|
||||
;;
|
||||
esac
|
||||
|
||||
cd /data
|
||||
|
||||
if [ ! -e minecraft_server.$VERSION.jar ]; then
|
||||
wget https://s3.amazonaws.com/Minecraft.Download/versions/$VERSION/minecraft_server.$VERSION.jar
|
||||
fi
|
||||
|
||||
if [ ! -e server.properties ]; then
|
||||
cp /tmp/server.properties .
|
||||
fi
|
||||
|
||||
sed -i "/motd\s*=/ c motd=$MOTD" /data/server.properties
|
||||
sed -i "/level-name\s*=/ c level-name=$LEVEL" /data/server.properties
|
||||
|
||||
java $JVM_OPTS -jar minecraft_server.$VERSION.jar
|
||||
set -e
|
||||
chown -R minecraft:minecraft /data
|
||||
exec su -s /bin/bash -c /start-minecraft minecraft
|
||||
|
||||
17
titan-gremlin/Dockerfile
Normal file
17
titan-gremlin/Dockerfile
Normal file
@@ -0,0 +1,17 @@
|
||||
FROM itzg/ubuntu-openjdk-7
|
||||
|
||||
MAINTAINER itzg
|
||||
|
||||
RUN apt-get install -y wget unzip
|
||||
|
||||
RUN wget -q -O /tmp/titan.zip http://s3.thinkaurelius.com/downloads/titan/titan-0.5.0-hadoop2.zip
|
||||
RUN unzip /tmp/titan.zip -d /opt && rm /tmp/titan.zip
|
||||
|
||||
ENV TITAN_HOME /opt/titan-0.5.0-hadoop2
|
||||
WORKDIR $TITAN_HOME
|
||||
|
||||
VOLUME ["/conf","/data"]
|
||||
ADD start-gremlin.sh /opt/start-gremlin.sh
|
||||
|
||||
CMD ["/bin/bash", "-e", "/opt/start-gremlin.sh"]
|
||||
|
||||
14
titan-gremlin/README.md
Normal file
14
titan-gremlin/README.md
Normal file
@@ -0,0 +1,14 @@
|
||||
Runs the Gremlin console from the Titan Graph Database "all" distribution.
|
||||
|
||||
To start the Gremlin console with the default configuration files available:
|
||||
|
||||
docker run -it itzg/titan-gremlin
|
||||
|
||||
In order to adjust or further define property files to use within Gremlin,
|
||||
attach a host directory to the container's `/conf` such as
|
||||
|
||||
docker run -it -v $(pwd)/conf:/conf itzg/titan-gremlin
|
||||
|
||||
After running once your host directory will be populated with the distribution-default
|
||||
configuration files. Modify those or add to them and they will available during
|
||||
the next use of gremlin.
|
||||
7
titan-gremlin/start-gremlin.sh
Executable file
7
titan-gremlin/start-gremlin.sh
Executable file
@@ -0,0 +1,7 @@
|
||||
#!/bin/bash
|
||||
|
||||
if [ $(ls /conf|wc -l) = 0 ]; then
|
||||
cp -r $TITAN_HOME/conf/* /conf
|
||||
fi
|
||||
|
||||
$TITAN_HOME/bin/gremlin.sh
|
||||
54
titandb/Dockerfile
Normal file
54
titandb/Dockerfile
Normal file
@@ -0,0 +1,54 @@
|
||||
FROM itzg/ubuntu-openjdk-7
|
||||
|
||||
MAINTAINER itzg
|
||||
|
||||
ENV APT_GET_UPDATE 2014-07-19
|
||||
|
||||
RUN apt-get update
|
||||
RUN apt-get install -y wget unzip
|
||||
|
||||
ENV TITAN_VER 0.4.4
|
||||
ENV TITAN_STORAGE all
|
||||
ENV REXSTER_VER 2.4.0
|
||||
|
||||
RUN wget -O /tmp/titan.zip http://s3.thinkaurelius.com/downloads/titan/titan-$TITAN_STORAGE-$TITAN_VER.zip
|
||||
RUN wget -O /tmp/rexster.zip http://tinkerpop.com/downloads/rexster/rexster-server-$REXSTER_VER.zip
|
||||
|
||||
WORKDIR /opt
|
||||
|
||||
RUN unzip /tmp/titan.zip
|
||||
RUN rm /tmp/titan.zip
|
||||
|
||||
RUN unzip /tmp/rexster.zip
|
||||
RUN rm /tmp/rexster.zip
|
||||
|
||||
RUN ln -s titan-$TITAN_STORAGE-$TITAN_VER titan
|
||||
RUN ln -s rexster-server-$REXSTER_VER rexster-server
|
||||
|
||||
RUN mkdir /opt/rexster-server/ext/titan
|
||||
RUN ln -s /opt/titan-$TITAN_STORAGE-$TITAN_VER/lib/* /opt/rexster-server/ext/titan
|
||||
RUN wget -O /opt/rexster-server/ext/titan/titan-rexter-$TITAN_VER.jar \
|
||||
http://central.maven.org/maven2/com/thinkaurelius/titan/titan-rexster/$TITAN_VER/titan-rexster-$TITAN_VER.jar
|
||||
|
||||
# Clean up distro area
|
||||
RUN rm /opt/rexster-server/ext/titan/log4j* /opt/rexster-server/ext/titan/slf4j*
|
||||
RUN rm /opt/rexster-server/lib/lucene-core*
|
||||
|
||||
ADD gremlin /usr/local/bin/gremlin
|
||||
ADD rexster /usr/local/bin/rexster
|
||||
|
||||
WORKDIR titan
|
||||
|
||||
ADD titan.properties /opt/titan/conf/titan.properties
|
||||
ADD init-graph-storage.groovy /tmp/init-graph-storage.groovy
|
||||
|
||||
VOLUME ["/data", "/config", "/scripts"]
|
||||
RUN ln -s /data /opt/titan/db
|
||||
|
||||
RUN gremlin -e /tmp/init-graph-storage.groovy && rm /tmp/init-graph-storage.groovy
|
||||
|
||||
EXPOSE 8182 8184
|
||||
|
||||
ADD rexster.xml /config/rexster.xml
|
||||
|
||||
CMD ["/usr/local/bin/rexster", "-s", "-c", "/config/rexster.xml"]
|
||||
3
titandb/gremlin
Executable file
3
titandb/gremlin
Executable file
@@ -0,0 +1,3 @@
|
||||
#!/bin/sh
|
||||
|
||||
/opt/titan/bin/gremlin.sh $*
|
||||
12
titandb/init-graph-storage.groovy
Normal file
12
titandb/init-graph-storage.groovy
Normal file
@@ -0,0 +1,12 @@
|
||||
import com.thinkaurelius.titan.core.TitanFactory
|
||||
import com.thinkaurelius.titan.core.TitanGraph
|
||||
import com.thinkaurelius.titan.graphdb.configuration.GraphDatabaseConfiguration
|
||||
import org.apache.commons.configuration.BaseConfiguration
|
||||
import org.apache.commons.configuration.Configuration
|
||||
|
||||
// Setup a blank one
|
||||
|
||||
TitanGraph g = TitanFactory.open('conf/titan.properties')
|
||||
g.shutdown()
|
||||
|
||||
|
||||
14
titandb/rexster
Executable file
14
titandb/rexster
Executable file
@@ -0,0 +1,14 @@
|
||||
#!/bin/sh
|
||||
|
||||
if [ -n "$PUBLISH_ADDR" ]; then
|
||||
echo "Enabling Doghouse access at http://$PUBLISH_ADDR:8182/doghouse"
|
||||
sed -i "s#<base-uri>.*</base-uri>#<base-uri>http://$PUBLISH_ADDR</base-uri>#" /config/rexster.xml
|
||||
fi
|
||||
|
||||
if [ -n "$SCRIPT" ]; then
|
||||
echo "Running Gremlin script $SCRIPT from /scripts..."
|
||||
gremlin -e /scripts/$SCRIPT
|
||||
fi
|
||||
|
||||
echo "Starting Rexster..."
|
||||
/opt/rexster-server/bin/rexster.sh $*
|
||||
28
titandb/rexster.xml
Normal file
28
titandb/rexster.xml
Normal file
@@ -0,0 +1,28 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<rexster>
|
||||
<http>
|
||||
<base-uri>http://localhost</base-uri>
|
||||
</http>
|
||||
<graphs>
|
||||
<graph>
|
||||
<graph-name>titan</graph-name>
|
||||
<graph-type>com.thinkaurelius.titan.tinkerpop.rexster.TitanGraphConfiguration</graph-type>
|
||||
<graph-location>/data/persistit</graph-location>
|
||||
<graph-read-only>false</graph-read-only>
|
||||
<properties>
|
||||
<storage.backend>persistit</storage.backend>
|
||||
<storage.directory>/data/persistit</storage.directory>
|
||||
<storage.buffercount>5000</storage.buffercount>
|
||||
<storage.index.search.backend>elasticsearch</storage.index.search.backend>
|
||||
<storage.index.search.local-mode>true</storage.index.search.local-mode>
|
||||
<storage.index.search.client-only>false</storage.index.search.client-only>
|
||||
<storage.index.search.directory>/data/es</storage.index.search.directory>
|
||||
</properties>
|
||||
<extensions>
|
||||
<allows>
|
||||
<allow>tp:gremlin</allow>
|
||||
</allows>
|
||||
</extensions>
|
||||
</graph>
|
||||
</graphs>
|
||||
</rexster>
|
||||
7
titandb/scripts/GraphOfTheGods.groovy
Normal file
7
titandb/scripts/GraphOfTheGods.groovy
Normal file
@@ -0,0 +1,7 @@
|
||||
import com.thinkaurelius.titan.core.TitanFactory
|
||||
import com.thinkaurelius.titan.example.GraphOfTheGodsFactory
|
||||
|
||||
def g = TitanFactory.open('conf/titan.properties')
|
||||
GraphOfTheGodsFactory.load(g)
|
||||
|
||||
g.shutdown()
|
||||
8
titandb/titan.properties
Normal file
8
titandb/titan.properties
Normal file
@@ -0,0 +1,8 @@
|
||||
storage.backend=persistit
|
||||
storage.directory=/data/persistit
|
||||
storage.buffercount=5000
|
||||
|
||||
storage.index.search.backend=elasticsearch
|
||||
storage.index.search.local-mode=true
|
||||
storage.index.search.client-only=false
|
||||
storage.index.search.directory=/data/es
|
||||
@@ -2,8 +2,7 @@ FROM ubuntu:trusty
|
||||
|
||||
MAINTAINER itzg
|
||||
|
||||
ENV APT_GET_UPDATE 2014-07-19
|
||||
|
||||
ENV APT_GET_UPDATE 2014-10-14
|
||||
RUN apt-get update
|
||||
RUN apt-get install -y openjdk-7-jre-headless
|
||||
|
||||
|
||||
Reference in New Issue
Block a user