mirror of
https://github.com/itzg/docker-minecraft-server.git
synced 2026-06-06 18:59:44 +00:00
Compare commits
85 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 19b77ba18b | |||
| f911230c1b | |||
| 1c7469bb8c | |||
| b5abb012db | |||
| 64b428f920 | |||
| 9ffdc49c1b | |||
| 3f5fa1642b | |||
| 6570028c06 | |||
| ed19d745cb | |||
| f2e6696368 | |||
| 83c31483f7 | |||
| b077b3fcf2 | |||
| 81ab299419 | |||
| 53a0d0cf7a | |||
| 99b884f18a | |||
| ebc0405e72 | |||
| b86370295c | |||
| 7e624b90dd | |||
| 6ba5fe29c1 | |||
| f9c7dddb19 | |||
| ea32f70dd7 | |||
| 0f466e2146 | |||
| 128dd8950a | |||
| 5c947fd4ab | |||
| 5792b2996a | |||
| 57ca565d64 | |||
| 63925a794c | |||
| d4d070018a | |||
| 8594054047 | |||
| 6f62af7d85 | |||
| b1f9d1c7c6 | |||
| 8c3b0a720d | |||
| cc3730e5a9 | |||
| 7b58d59cef | |||
| 84c3ea2465 | |||
| 78d9add46c | |||
| 2f18e7be04 | |||
| 011108cd7e | |||
| 1600b75513 | |||
| 9962d28f41 | |||
| ea08a6b496 | |||
| a61d44ff30 | |||
| 5e14d3fbdd | |||
| eb28c2c980 | |||
| 024800201f | |||
| 32e5f94a87 | |||
| 88032acbfb | |||
| 22e1abe628 | |||
| 01d9c54575 | |||
| fab9669b42 | |||
| df09adbfd7 | |||
| 9e373d8b4d | |||
| 2f4b73d862 | |||
| a252d794f9 | |||
| 79438e14de | |||
| ddbc7e9618 | |||
| 87140179f2 | |||
| 14a1e5fb2a | |||
| 2e8704a311 | |||
| b1741cab7b | |||
| d63bc698d8 | |||
| 574fc53a55 | |||
| b75379a980 | |||
| 086d9fb4ae | |||
| 214fcda183 | |||
| 4dff67e03b | |||
| 78d82b334b | |||
| 3059282c7a | |||
| 88509c66a6 | |||
| 307a9b119f | |||
| 6c58660a73 | |||
| b7f5088b13 | |||
| abee16a143 | |||
| 8319b336c7 | |||
| 6ea862859b | |||
| 88a796bb44 | |||
| a8c3afbe88 | |||
| 60b6eea1e2 | |||
| bc9afcd659 | |||
| 052f80d849 | |||
| 7e847829ee | |||
| 44c0eee0f9 | |||
| 0337f9fac1 | |||
| 287185919a | |||
| b895e07e82 |
@@ -2,3 +2,5 @@ dockerfiles
|
|||||||
===========
|
===========
|
||||||
|
|
||||||
Contains the various Dockerfile definitions I'm maintaining.
|
Contains the various Dockerfile definitions I'm maintaining.
|
||||||
|
|
||||||
|
[](https://gitter.im/itzg/dockerfiles?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge)
|
||||||
|
|||||||
@@ -1,4 +1,11 @@
|
|||||||
pkgs="ubuntu-openjdk-7 gvm spring-boot"
|
#!/bin/bash
|
||||||
|
|
||||||
|
pkgs=ubuntu-openjdk-7
|
||||||
|
pkgs="$pkgs minecraft-server"
|
||||||
|
pkgs="$pkgs elasticsearch"
|
||||||
|
pkgs="$pkgs kibana"
|
||||||
|
pkgs="$pkgs titan-gremlin"
|
||||||
|
pkgs="$pkgs cassandra"
|
||||||
|
|
||||||
for p in $pkgs
|
for p in $pkgs
|
||||||
do
|
do
|
||||||
|
|||||||
Executable
+26
@@ -0,0 +1,26 @@
|
|||||||
|
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"]
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
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.
|
||||||
Executable
+27
@@ -0,0 +1,27 @@
|
|||||||
|
#!/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
|
||||||
|
|
||||||
+11
@@ -0,0 +1,11 @@
|
|||||||
|
machine:
|
||||||
|
services:
|
||||||
|
- docker
|
||||||
|
|
||||||
|
test:
|
||||||
|
override:
|
||||||
|
- ./build
|
||||||
|
|
||||||
|
notify:
|
||||||
|
webhooks:
|
||||||
|
- url: https://webhooks.gitter.im/e/4726bb683d8aed018486
|
||||||
@@ -1,9 +1,8 @@
|
|||||||
FROM itzg/ubuntu-openjdk-7
|
FROM itzg/ubuntu-openjdk-7
|
||||||
|
|
||||||
MAINTAINER itzg
|
MAINTAINER itzg
|
||||||
RUN apt-get install -y wget && apt-get clean
|
|
||||||
|
|
||||||
ENV ES_VERSION 1.4.1
|
ENV ES_VERSION 1.6.0
|
||||||
|
|
||||||
RUN wget -qO /tmp/es.tgz https://download.elasticsearch.org/elasticsearch/elasticsearch/elasticsearch-$ES_VERSION.tar.gz && \
|
RUN wget -qO /tmp/es.tgz https://download.elasticsearch.org/elasticsearch/elasticsearch/elasticsearch-$ES_VERSION.tar.gz && \
|
||||||
cd /usr/share && \
|
cd /usr/share && \
|
||||||
|
|||||||
@@ -0,0 +1,13 @@
|
|||||||
|
FROM itzg/ubuntu-openjdk-7
|
||||||
|
|
||||||
|
MAINTAINER itzg
|
||||||
|
|
||||||
|
RUN DEBIAN_FRONTEND=noninteractive apt-get -y install curl && apt-get clean
|
||||||
|
|
||||||
|
ADD download-and-start.sh /download-and-start
|
||||||
|
|
||||||
|
ENV JENKINS_HOME /data
|
||||||
|
VOLUME ["/data"]
|
||||||
|
EXPOSE 8080 38252
|
||||||
|
|
||||||
|
CMD ["/download-and-start"]
|
||||||
@@ -0,0 +1,49 @@
|
|||||||
|
A self-upgrading [Jenkins CI](http://jenkins-ci.org/) server
|
||||||
|
|
||||||
|
# Basic Usage
|
||||||
|
|
||||||
|
To start Jenkins with the latest version:
|
||||||
|
|
||||||
|
ID=$(docker run -d -p 8080:8080 itzg/jenkins)
|
||||||
|
|
||||||
|
At a later time, you can upgrade by restarting the container:
|
||||||
|
|
||||||
|
docker stop $ID
|
||||||
|
docker start $ID
|
||||||
|
|
||||||
|
# Attaching host directory to Jenkins home directory
|
||||||
|
|
||||||
|
The Jenkins home directory is attachable at `/data`, so attaching to a host volume
|
||||||
|
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
|
||||||
|
by JNLP. Since Docker networking is basically a firewall, a random port
|
||||||
|
won't work for us. Instead the fixed port **38252** was chosen (arbitrarily)
|
||||||
|
to be exposed by the container.
|
||||||
|
|
||||||
|
Launch your Jenkins container using
|
||||||
|
|
||||||
|
ID=$(docker run -d -p 8080:8080 -p 38252:38252 itzg/jenkins)
|
||||||
|
|
||||||
|
and configure the port in the Global Security settings:
|
||||||
|
|
||||||
|

|
||||||
Executable
+29
@@ -0,0 +1,29 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
mirrorUrl=http://mirrors.jenkins-ci.org/war/latest/jenkins.war
|
||||||
|
url=$(curl -s --head $mirrorUrl|awk -F': ' '$1 == "Location" { print $2 }' | sed 's/[[:space:]]*$//')
|
||||||
|
version=$(echo $url | sed 's#.*/war/\(.*\)/jenkins.war#\1#')
|
||||||
|
|
||||||
|
mkdir -p /opt/jenkins
|
||||||
|
trackingFile=/opt/jenkins/INSTALLED
|
||||||
|
|
||||||
|
installed=
|
||||||
|
if [ -f $trackingFile ]; then
|
||||||
|
installed=$(cat $trackingFile)
|
||||||
|
echo "Version installed is $installed"
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ $version != "$installed" ]; then
|
||||||
|
echo "Downloading $version from '$url'"
|
||||||
|
while ! curl -s -o /opt/jenkins/jenkins.war "$url"
|
||||||
|
do
|
||||||
|
echo "Trying again in 5 seconds"
|
||||||
|
sleep 5
|
||||||
|
done
|
||||||
|
|
||||||
|
echo $version > $trackingFile
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
cd /opt/jenkins
|
||||||
|
exec java -jar jenkins.war
|
||||||
Executable
+21
@@ -0,0 +1,21 @@
|
|||||||
|
FROM itzg/ubuntu-openjdk-7
|
||||||
|
|
||||||
|
MAINTAINER itzg
|
||||||
|
|
||||||
|
ENV KIBANA_VERSION 4.1.1
|
||||||
|
|
||||||
|
RUN wget -q -O /tmp/kibana.tgz https://download.elasticsearch.org/kibana/kibana/kibana-${KIBANA_VERSION}-linux-x64.tar.gz
|
||||||
|
|
||||||
|
RUN tar -C /opt -xzf /tmp/kibana.tgz && rm /tmp/kibana.tgz
|
||||||
|
ENV KIBANA_HOME /opt/kibana-$KIBANA_VERSION-linux-x64
|
||||||
|
|
||||||
|
# Simplify for cross-container
|
||||||
|
ENV ES_URL http://es:9200
|
||||||
|
|
||||||
|
WORKDIR $KIBANA_HOME
|
||||||
|
|
||||||
|
ADD start.sh /start
|
||||||
|
|
||||||
|
EXPOSE 5601
|
||||||
|
|
||||||
|
CMD ["/start"]
|
||||||
@@ -0,0 +1,26 @@
|
|||||||
|
|
||||||
|
Provides a ready-to-run [Kibana](http://www.elasticsearch.org/overview/kibana/) server that can
|
||||||
|
easily hook into your [Elasticsearch containers](https://registry.hub.docker.com/u/itzg/elasticsearch/).
|
||||||
|
|
||||||
|
## Usage with Docker elasticsearch container
|
||||||
|
|
||||||
|
This is by far the easiest and most Docker'ish way to run Kibana.
|
||||||
|
|
||||||
|
Assuming you started one or more containers using something like
|
||||||
|
|
||||||
|
docker run -d --name your-es -p 9200:9200 itzg/elasticsearch
|
||||||
|
|
||||||
|
Start Kibana using
|
||||||
|
|
||||||
|
docker run -d -p 5601:5601 --link your-es:es itzg/kibana
|
||||||
|
|
||||||
|
Proceed to use Kibana starting from
|
||||||
|
[this point in the documentation](http://www.elasticsearch.org/guide/en/kibana/current/access.html)
|
||||||
|
|
||||||
|
## Usage with non-Docker elasticsearch
|
||||||
|
|
||||||
|
Start Kibana using
|
||||||
|
|
||||||
|
docker run -d -p 5601:5601 -e ES_URL=http://YOUR_ES:9200 itzg/kibana
|
||||||
|
|
||||||
|
Replacing `http://YOUR_ES:9200` with the appropriate URL for your system.
|
||||||
Executable
+6
@@ -0,0 +1,6 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
OPTS="-e $ES_URL"
|
||||||
|
|
||||||
|
exec bin/kibana $OPTS
|
||||||
|
|
||||||
Executable
+25
@@ -0,0 +1,25 @@
|
|||||||
|
FROM itzg/ubuntu-openjdk-7
|
||||||
|
|
||||||
|
MAINTAINER itzg
|
||||||
|
|
||||||
|
ENV LOGSTASH_VERSION 1.5.0-1
|
||||||
|
|
||||||
|
RUN wget -qO /tmp/logstash.deb http://download.elastic.co/logstash/logstash/packages/debian/logstash_${LOGSTASH_VERSION}_all.deb
|
||||||
|
|
||||||
|
RUN dpkg -i /tmp/logstash.deb && rm /tmp/logstash.deb
|
||||||
|
|
||||||
|
WORKDIR /opt/logstash
|
||||||
|
|
||||||
|
# For collectd reception
|
||||||
|
EXPOSE 25826
|
||||||
|
|
||||||
|
# /conf is the default directory where our logstash will read pipeline config files
|
||||||
|
# /logs is an optional attach point to reference something like /var/log on the host
|
||||||
|
VOLUME ["/conf","/logs"]
|
||||||
|
|
||||||
|
ENV PLUGIN_UPDATES 2015-06-10
|
||||||
|
|
||||||
|
RUN bin/plugin install logstash-input-heartbeat
|
||||||
|
RUN bin/plugin install logstash-output-elasticsearch_groom
|
||||||
|
|
||||||
|
CMD ["bin/logstash","agent","-f","/conf"]
|
||||||
@@ -0,0 +1,44 @@
|
|||||||
|
This image bundles the latest (1.5.x) version of Logstash with the ability to
|
||||||
|
groom its own Elasticsearch indices.
|
||||||
|
|
||||||
|
# Basic Usage
|
||||||
|
|
||||||
|
To start a Logstash container, setup a directory on your host with one or more Logstash
|
||||||
|
pipeline configurations files, called `$HOST_CONF` here, and run
|
||||||
|
|
||||||
|
docker run -d -v $HOST_CONF:/conf itzg/logstash
|
||||||
|
|
||||||
|
# Accessing host logs
|
||||||
|
|
||||||
|
Logstash is much more useful when it is actually processing...logs. Logs inside the container
|
||||||
|
are non-existent, but you can attach the host machine's `/var/log` directory via the container's
|
||||||
|
`/logs` volume:
|
||||||
|
|
||||||
|
docker run ... -v /var/log:/logs ...
|
||||||
|
|
||||||
|
Keep in mind you will need to configure `file` inputs with a base path of `/logs`, such as
|
||||||
|
|
||||||
|
```
|
||||||
|
file {
|
||||||
|
path => ['/logs/syslog']
|
||||||
|
type => 'syslog'
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
# Receiving input from collectd
|
||||||
|
|
||||||
|
To allow for incoming [collectd](https://collectd.org/) content, **UDP** port 25826 is exposed and
|
||||||
|
can be mapped onto the host using:
|
||||||
|
|
||||||
|
docker run ... -p 25826:25826/udp
|
||||||
|
|
||||||
|
Regardless of the host port, be sure to configure the logstash input to bind at port `25826`, such
|
||||||
|
as
|
||||||
|
|
||||||
|
```
|
||||||
|
udp {
|
||||||
|
port => 25826
|
||||||
|
codec => collectd { }
|
||||||
|
buffer_size => 1452
|
||||||
|
}
|
||||||
|
```
|
||||||
@@ -0,0 +1,25 @@
|
|||||||
|
input {
|
||||||
|
heartbeat {
|
||||||
|
type => 'groom'
|
||||||
|
interval => 11
|
||||||
|
add_field => {
|
||||||
|
scope => 'open'
|
||||||
|
cutoff => '4w'
|
||||||
|
action => 'close'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
output {
|
||||||
|
|
||||||
|
if [type] == 'groom' {
|
||||||
|
elasticsearch_groom {
|
||||||
|
host => 'es:9200'
|
||||||
|
index => 'logstash-%{+YYYY.MM.dd}'
|
||||||
|
scope => '%{scope}'
|
||||||
|
age_cutoff => '%{cutoff}'
|
||||||
|
action => '%{action}'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
data
|
||||||
+15
-10
@@ -2,28 +2,33 @@ FROM itzg/ubuntu-openjdk-7
|
|||||||
|
|
||||||
MAINTAINER itzg
|
MAINTAINER itzg
|
||||||
|
|
||||||
RUN apt-get install -y wget libmozjs-24-bin imagemagick && apt-get clean
|
ENV APT_GET_UPDATE 2015-03-28
|
||||||
|
RUN apt-get update
|
||||||
|
|
||||||
|
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 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 wget -O /usr/bin/jsawk https://github.com/micha/jsawk/raw/master/jsawk
|
||||||
RUN chmod +x /usr/bin/jsawk
|
RUN chmod +x /usr/bin/jsawk
|
||||||
RUN useradd -M -s /bin/false minecraft \
|
RUN useradd -M -s /bin/false --uid 1000 minecraft \
|
||||||
&& mkdir /data \
|
&& mkdir /data \
|
||||||
&& chown minecraft:minecraft /data
|
&& chown minecraft:minecraft /data
|
||||||
|
|
||||||
EXPOSE 25565
|
EXPOSE 25565
|
||||||
|
|
||||||
ADD start.sh /start
|
COPY start.sh /start
|
||||||
ADD start-minecraft.sh /start-minecraft
|
COPY start-minecraft.sh /start-minecraft
|
||||||
|
|
||||||
USER minecraft
|
VOLUME ["/data"]
|
||||||
VOLUME ['/data']
|
COPY server.properties /tmp/server.properties
|
||||||
ADD server.properties /tmp/server.properties
|
|
||||||
WORKDIR /data
|
WORKDIR /data
|
||||||
|
|
||||||
CMD [ "/start-minecraft" ]
|
CMD [ "/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 MOTD A Minecraft Server Powered by Docker
|
||||||
ENV LEVEL world
|
|
||||||
ENV JVM_OPTS -Xmx1024M -Xms1024M
|
ENV JVM_OPTS -Xmx1024M -Xms1024M
|
||||||
ENV VERSION 1.8.1
|
ENV TYPE=VANILLA VERSION=LATEST FORGEVERSION=RECOMMENDED LEVEL=world PVP=true DIFFICULTY=easy
|
||||||
|
|||||||
+138
-23
@@ -1,12 +1,15 @@
|
|||||||
This docker image provides a Minecraft Server that will automatically download the latest stable,
|
This docker image provides a Minecraft Server that will automatically download the latest stable
|
||||||
latest snapshot, or any specific version.
|
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
|
To simply use the latest stable version, run
|
||||||
|
|
||||||
docker run -d -p 25565:25565 itzg/minecraft-server
|
docker run -d -p 25565:25565 itzg/minecraft-server
|
||||||
|
|
||||||
where the default server port, 25565, will be exposed on your host machine. If you want to serve up multiple
|
where the standard server port, 25565, will be exposed on your host machine.
|
||||||
Minecraft servers or just use an alternate port, change the host-side port mapping such as
|
|
||||||
|
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 -p 25566:25565 ...
|
docker run -p 25566:25565 ...
|
||||||
|
|
||||||
@@ -15,16 +18,35 @@ will serve your Minecraft server on your host's port 25566 since the `-p` syntax
|
|||||||
|
|
||||||
Speaking of multiple servers, it's handy to give your containers explicit names using `--name`, such as
|
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
|
docker run -d -p 25565:25565 --name mc itzg/minecraft-server
|
||||||
|
|
||||||
With that you can easily view the logs, stop, or re-start the container:
|
With that you can easily view the logs, stop, or re-start the container:
|
||||||
|
|
||||||
docker logs -f minecraft-default
|
docker logs -f mc
|
||||||
( Ctrl-C to exit logs action )
|
( Ctrl-C to exit logs action )
|
||||||
|
|
||||||
docker stop minecraft-default
|
docker stop mc
|
||||||
|
|
||||||
docker start minecraft-default
|
docker start mc
|
||||||
|
|
||||||
|
## Interacting with the server
|
||||||
|
|
||||||
|
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
|
||||||
|
|
||||||
|
With that you can attach and interact at any time using
|
||||||
|
|
||||||
|
docker attach mc
|
||||||
|
|
||||||
|
and then Control-p Control-q to **detach**.
|
||||||
|
|
||||||
|
For remote access, configure your Docker daemon to use a `tcp` socket (such as `-H tcp://0.0.0.0:2375`)
|
||||||
|
and attach from another machine:
|
||||||
|
|
||||||
|
docker -H $HOST:2375 attach mc
|
||||||
|
|
||||||
|
Unless you're on a home/private LAN, you should [enable TLS access](https://docs.docker.com/articles/https/).
|
||||||
|
|
||||||
## EULA Support
|
## EULA Support
|
||||||
|
|
||||||
@@ -34,16 +56,27 @@ Mojang now requires accepting the [Minecraft EULA](https://account.mojang.com/do
|
|||||||
|
|
||||||
such as
|
such as
|
||||||
|
|
||||||
docker run -e EULA=TRUE -d -p 25565:25565 itzg/minecraft-server
|
docker run -d -it -e EULA=TRUE -p 25565:25565 itzg/minecraft-server
|
||||||
|
|
||||||
## Attaching data directory to host filesystem
|
## 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
|
In order to readily access the Minecraft data, use the `-v` argument
|
||||||
to map a directory on your host machine to the container's `/data` directory, such as:
|
to map a directory on your host machine to the container's `/data` directory, such as:
|
||||||
|
|
||||||
docker run -d -v /path/on/host:/data ...
|
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.
|
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:
|
||||||
|
|
||||||
|
-e UID=1000
|
||||||
|
|
||||||
|
replacing 1000 with a UID that is present on the host.
|
||||||
|
Here is one way to find the UID given a username:
|
||||||
|
|
||||||
|
grep some_host_user /etc/passwd|cut -d: -f3
|
||||||
|
|
||||||
## Versions
|
## Versions
|
||||||
|
|
||||||
@@ -61,32 +94,114 @@ or a specific version:
|
|||||||
|
|
||||||
docker run -d -e VERSION=1.7.9 ...
|
docker run -d -e VERSION=1.7.9 ...
|
||||||
|
|
||||||
|
## Running a Forge Server
|
||||||
|
|
||||||
|
Enable Forge server mode by adding a `-e TYPE=FORGE` to your command-line.
|
||||||
|
By default the container will run the `RECOMMENDED` version of [Forge server](http://www.minecraftforge.net/wiki/)
|
||||||
|
but you can also choose to run a specific version with `-e FORGEVERSION=10.13.4.1448`.
|
||||||
|
|
||||||
|
$ 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
|
||||||
|
|
||||||
|
In order to add mods, you will need to attach the container's `/data` directory
|
||||||
|
(see "Attaching data directory to host filesystem”).
|
||||||
|
Then, you can add mods to the `/path/on/host/mods` folder you chose. From the example above,
|
||||||
|
the `/path/on/host` folder contents look like:
|
||||||
|
|
||||||
|
```
|
||||||
|
/path/on/host
|
||||||
|
├── mods
|
||||||
|
│ └── ... INSTALL MODS HERE ...
|
||||||
|
├── config
|
||||||
|
│ └── ... CONFIGURE MODS HERE ...
|
||||||
|
├── ops.json
|
||||||
|
├── server.properties
|
||||||
|
├── whitelist.json
|
||||||
|
└── ...
|
||||||
|
```
|
||||||
|
|
||||||
|
If you add mods while the container is running, you'll need to restart it to pick those
|
||||||
|
up:
|
||||||
|
|
||||||
|
docker stop $ID
|
||||||
|
docker start $ID
|
||||||
|
|
||||||
## Server configuration
|
## Server configuration
|
||||||
|
|
||||||
You can either switch between world saves or run multiple containers with different saves by using the `LEVEL` option,
|
### Difficulty
|
||||||
where the default is "world":
|
|
||||||
|
|
||||||
docker run -d -e LEVEL=bonus ...
|
The difficulty level (default: `easy`) can be set like:
|
||||||
|
|
||||||
**NOTE:** if running multiple containers be sure to either specify a different `-v` host directory for each
|
docker run -d -e DIFFICULTY=hard
|
||||||
`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
|
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.
|
||||||
|
|
||||||
docker run -d -e 'MOTD=My Server' ...
|
### Op/Administrator Players
|
||||||
|
|
||||||
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
|
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 ...
|
docker run -d -e OPS=user1,user2 ...
|
||||||
|
|
||||||
|
### Server icon
|
||||||
|
|
||||||
A server icon can be configured using the `ICON` variable. The image will be automatically
|
A server icon can be configured using the `ICON` variable. The image will be automatically
|
||||||
downloaded, scaled, and converted from any other image format:
|
downloaded, scaled, and converted from any other image format:
|
||||||
|
|
||||||
docker run -d -e ICON=http://..../some/image.png
|
docker run -d -e ICON=http://..../some/image.png ...
|
||||||
|
|
||||||
|
### Level Seed
|
||||||
|
|
||||||
|
If you want to create the Minecraft level with a specific seed, use `SEED`, such as
|
||||||
|
|
||||||
|
docker run -d -e SEED=1785852800490497919 ...
|
||||||
|
|
||||||
|
### Game Mode
|
||||||
|
|
||||||
|
By default, Minecraft servers are configured to run in Survival mode. You can
|
||||||
|
change the mode using `MODE` where you can either provide the [standard
|
||||||
|
numerical values](http://minecraft.gamepedia.com/Game_mode#Game_modes) or the
|
||||||
|
shortcut values:
|
||||||
|
|
||||||
|
* creative
|
||||||
|
* survival
|
||||||
|
|
||||||
|
For example:
|
||||||
|
|
||||||
|
docker run -d -e MODE=creative ...
|
||||||
|
|
||||||
|
### Message of the Day
|
||||||
|
|
||||||
|
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' ...
|
||||||
|
|
||||||
|
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`
|
||||||
|
environment variable set to `false`, such as
|
||||||
|
|
||||||
|
docker run -d -e PVP=false ...
|
||||||
|
|
||||||
|
### 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 ...
|
||||||
|
|
||||||
|
**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
|
||||||
|
|
||||||
|
### Memory Limit
|
||||||
|
|
||||||
The Java memory limit can be adjusted using the `JVM_OPTS` environment variable, where the default is
|
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):
|
the setting shown in the example (max and min at 1024 MB):
|
||||||
|
|
||||||
|
|||||||
@@ -1,47 +1,4 @@
|
|||||||
#!/bin/sh
|
#!/bin/bash
|
||||||
|
|
||||||
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 [ ! -e /data/eula.txt ]; then
|
||||||
if [ "$EULA" != "" ]; then
|
if [ "$EULA" != "" ]; then
|
||||||
@@ -58,4 +15,154 @@ if [ ! -e /data/eula.txt ]; then
|
|||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
java $JVM_OPTS -jar minecraft_server.$VERSION.jar
|
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)'`
|
||||||
|
;;
|
||||||
|
SNAPSHOT)
|
||||||
|
VANILLA_VERSION=`wget -O - https://s3.amazonaws.com/Minecraft.Download/versions/versions.json | jsawk -n 'out(this.latest.snapshot)'`
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
VANILLA_VERSION=$VERSION
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
cd /data
|
||||||
|
|
||||||
|
echo "Checking minecraft / forge type information."
|
||||||
|
case $TYPE in
|
||||||
|
VANILLA)
|
||||||
|
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
|
||||||
|
;;
|
||||||
|
|
||||||
|
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
|
||||||
|
;;
|
||||||
|
|
||||||
|
*)
|
||||||
|
norm=`echo $VANILLA_VERSION | sed 's/^\([0-9]\+\.[0-9]\+\).*/\1/'`
|
||||||
|
;;
|
||||||
|
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"
|
||||||
|
fi
|
||||||
|
|
||||||
|
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
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
|
||||||
|
esac
|
||||||
|
|
||||||
|
if [ ! -e server.properties ]; then
|
||||||
|
cp /tmp/server.properties .
|
||||||
|
|
||||||
|
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 "$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
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ -n "$DIFFICULTY" ]; then
|
||||||
|
case $DIFFICULTY in
|
||||||
|
peaceful)
|
||||||
|
DIFFICULTY=0
|
||||||
|
;;
|
||||||
|
easy)
|
||||||
|
DIFFICULTY=1
|
||||||
|
;;
|
||||||
|
normal)
|
||||||
|
DIFFICULTY=2
|
||||||
|
;;
|
||||||
|
hard)
|
||||||
|
DIFFICULTY=3
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
echo "DIFFICULTY must be peaceful, easy, normal, or hard."
|
||||||
|
exit 1
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
sed -i "/difficulty\s*=/ c difficulty=$DIFFICULTY" /data/server.properties
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ -n "$MODE" ]; then
|
||||||
|
case ${MODE,,?} in
|
||||||
|
0|1|2|3)
|
||||||
|
;;
|
||||||
|
s*)
|
||||||
|
MODE=0
|
||||||
|
;;
|
||||||
|
c*)
|
||||||
|
MODE=1
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
echo "ERROR: Invalid game mode: $MODE"
|
||||||
|
exit 1
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
sed -i "/gamemode\s*=/ c gamemode=$MODE" /data/server.properties
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
if [ -n "$OPS" -a ! -e ops.txt.converted ]; then
|
||||||
|
echo $OPS | awk -v RS=, '{print}' >> ops.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"
|
||||||
|
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
|
||||||
|
|
||||||
|
exec java $JVM_OPTS -jar $SERVER
|
||||||
|
|||||||
@@ -1,4 +1,8 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
set -e
|
set -e
|
||||||
chown -R minecraft:minecraft /data
|
usermod --uid $UID minecraft
|
||||||
exec su -s /bin/bash -c /start-minecraft minecraft
|
chown -R minecraft /data /start-minecraft
|
||||||
|
|
||||||
|
exec sudo -E -u minecraft /start-minecraft
|
||||||
|
|
||||||
|
|||||||
Regular → Executable
+5
-6
@@ -2,16 +2,15 @@ FROM itzg/ubuntu-openjdk-7
|
|||||||
|
|
||||||
MAINTAINER itzg
|
MAINTAINER itzg
|
||||||
|
|
||||||
RUN apt-get install -y wget unzip
|
ENV TITAN_VERSION 0.5.4
|
||||||
|
|
||||||
RUN wget -q -O /tmp/titan.zip http://s3.thinkaurelius.com/downloads/titan/titan-0.5.0-hadoop2.zip
|
RUN wget -q -O /tmp/titan.zip http://s3.thinkaurelius.com/downloads/titan/titan-$TITAN_VERSION-hadoop2.zip
|
||||||
RUN unzip /tmp/titan.zip -d /opt && rm /tmp/titan.zip
|
RUN unzip -q /tmp/titan.zip -d /opt && rm /tmp/titan.zip
|
||||||
|
|
||||||
ENV TITAN_HOME /opt/titan-0.5.0-hadoop2
|
ENV TITAN_HOME /opt/titan-$TITAN_VERSION-hadoop2
|
||||||
WORKDIR $TITAN_HOME
|
WORKDIR $TITAN_HOME
|
||||||
|
|
||||||
VOLUME ["/conf","/data"]
|
VOLUME ["/conf","/data"]
|
||||||
ADD start-gremlin.sh /opt/start-gremlin.sh
|
ADD start-gremlin.sh /opt/start-gremlin.sh
|
||||||
|
|
||||||
CMD ["/bin/bash", "-e", "/opt/start-gremlin.sh"]
|
CMD ["/opt/start-gremlin.sh"]
|
||||||
|
|
||||||
|
|||||||
+34
-3
@@ -1,4 +1,6 @@
|
|||||||
Runs the Gremlin console from the Titan Graph Database "all" distribution.
|
Runs the Gremlin console from the Titan Graph Database's "all" distribution.
|
||||||
|
|
||||||
|
# Basic Usage
|
||||||
|
|
||||||
To start the Gremlin console with the default configuration files available:
|
To start the Gremlin console with the default configuration files available:
|
||||||
|
|
||||||
@@ -10,5 +12,34 @@ attach a host directory to the container's `/conf` such as
|
|||||||
docker run -it -v $(pwd)/conf:/conf itzg/titan-gremlin
|
docker run -it -v $(pwd)/conf:/conf itzg/titan-gremlin
|
||||||
|
|
||||||
After running once your host directory will be populated with the distribution-default
|
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
|
configuration files. Modify those or add to them and they will be available during
|
||||||
the next use of gremlin.
|
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.
|
||||||
|
|
||||||
|
docker run -d --name gremlin-cass itzg/cassandra
|
||||||
|
docker run -d --name gremlin-es itzg/elasticsearch
|
||||||
|
|
||||||
|
Now start Gremlin with networking links to those containers with the aliases
|
||||||
|
|
||||||
|
* `--link <container>:cass`
|
||||||
|
* `--link <container>:es`
|
||||||
|
|
||||||
|
such as
|
||||||
|
|
||||||
|
docker run -it --rm --link gremlin-cass:cass --link gremlin-es:es itzg/titan-gremlin
|
||||||
|
|
||||||
|
and with that you can follow the
|
||||||
|
[Graph of the Gods example](http://s3.thinkaurelius.com/docs/titan/current/getting-started.html), such as
|
||||||
|
|
||||||
|
gremlin> GraphOfTheGodsFactory.load(g)
|
||||||
|
gremlin> saturn = g.V.has('name','saturn').next()
|
||||||
|
==>v[256]
|
||||||
|
gremlin> saturn.map()
|
||||||
|
==>name=saturn
|
||||||
|
==>age=10000
|
||||||
|
gremlin> saturn.in('father').in('father').name
|
||||||
|
==>hercules
|
||||||
|
|||||||
@@ -1,7 +1,62 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
|
args=
|
||||||
|
|
||||||
if [ $(ls /conf|wc -l) = 0 ]; then
|
if [ $(ls /conf|wc -l) = 0 ]; then
|
||||||
cp -r $TITAN_HOME/conf/* /conf
|
cp -r $TITAN_HOME/conf/* /conf
|
||||||
fi
|
fi
|
||||||
|
|
||||||
$TITAN_HOME/bin/gremlin.sh
|
rm -f /tmp/titan.properties
|
||||||
|
|
||||||
|
if [ -n "$CASS_PORT_9160_TCP_ADDR" ]; then
|
||||||
|
|
||||||
|
shortcut=/tmp/titan.properties
|
||||||
|
cat >> /tmp/titan.properties <<END
|
||||||
|
storage.backend=cassandra
|
||||||
|
storage.hostname=$CASS_PORT_9160_TCP_ADDR
|
||||||
|
END
|
||||||
|
|
||||||
|
elif [ -n "$CASS_ADDR" ]; then
|
||||||
|
|
||||||
|
shortcut=/tmp/titan.properties
|
||||||
|
cat >> /tmp/titan.properties <<END
|
||||||
|
storage.backend=cassandra
|
||||||
|
storage.hostname=$CASS_ADDR
|
||||||
|
END
|
||||||
|
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
esAddr=${ES_ENV_PUBLISH_AS:-${ES_PORT_9300_TCP_ADDR}}
|
||||||
|
|
||||||
|
if [ -n "$ES_CLUSTER" -o -n "$esAddr" ]; then
|
||||||
|
shortcut=/tmp/titan.properties
|
||||||
|
cat >> /tmp/titan.properties <<END
|
||||||
|
index.search.backend=elasticsearch
|
||||||
|
index.search.elasticsearch.client-only=true
|
||||||
|
END
|
||||||
|
|
||||||
|
if [ -n "$ES_CLUSTER" ]; then
|
||||||
|
cat >> /tmp/titan.properties <<END
|
||||||
|
index.search.elasticsearch.ext.cluster.name=$ES_CLUSTER
|
||||||
|
END
|
||||||
|
fi
|
||||||
|
if [ -n "$esAddr" ]; then
|
||||||
|
# strip off the port spec, if present
|
||||||
|
esAddr=$(echo $esAddr | cut -d: -f1)
|
||||||
|
cat >> /tmp/titan.properties <<END
|
||||||
|
index.search.hostname=$esAddr
|
||||||
|
END
|
||||||
|
fi
|
||||||
|
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ -n "$shortcut" ]; then
|
||||||
|
cat > /tmp/init.groovy <<END
|
||||||
|
g = TitanFactory.open('$shortcut')
|
||||||
|
println 'The graph \'g\' was opened using $shortcut'
|
||||||
|
END
|
||||||
|
args="$args /tmp/init.groovy"
|
||||||
|
fi
|
||||||
|
|
||||||
|
exec $TITAN_HOME/bin/gremlin.sh $args
|
||||||
|
|||||||
Regular → Executable
+4
-2
@@ -2,8 +2,10 @@ FROM ubuntu:trusty
|
|||||||
|
|
||||||
MAINTAINER itzg
|
MAINTAINER itzg
|
||||||
|
|
||||||
ENV APT_GET_UPDATE 2014-10-14
|
ENV APT_GET_UPDATE 2015-07-16
|
||||||
RUN apt-get update
|
RUN apt-get update
|
||||||
RUN apt-get install -y openjdk-7-jre-headless
|
RUN DEBIAN_FRONTEND=noninteractive \
|
||||||
|
apt-get -q -y install openjdk-7-jre-headless wget unzip \
|
||||||
|
&& apt-get clean
|
||||||
|
|
||||||
ENV JAVA_HOME /usr/lib/jvm/java-7-openjdk-amd64
|
ENV JAVA_HOME /usr/lib/jvm/java-7-openjdk-amd64
|
||||||
|
|||||||
Reference in New Issue
Block a user