Compare commits

..

6 Commits

Author SHA1 Message Date
Geoff Bourne
7d8429ef0a Allowing for pre-existing eula.txt
Adding memory settings info to README
2014-09-08 02:32:55 +00:00
Geoff Bourne
df155ee51c Updating to JDK 7u65 2014-09-08 02:08:24 +00:00
Geoff Bourne
f85240898d Added support for Minecraft server EULA and update default to 1.8 2014-09-07 23:18:20 +00:00
Geoff Bourne
84154c3d64 * Installing JDK, not just JRE
* Added usage examples in README
2014-07-17 01:56:03 +00:00
Geoff Bourne
6163e080cd Merge branch 'master' of https://github.com/itzg/dockerfiles 2014-07-16 23:10:14 +00:00
Geoff Bourne
972036feb4 * Created devbox container 2014-07-16 23:09:33 +00:00
6 changed files with 105 additions and 23 deletions

29
devbox/Dockerfile Normal file
View 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
View 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".

View File

@@ -2,7 +2,6 @@ FROM itzg/ubuntu-openjdk-7
MAINTAINER itzg
RUN apt-get update
RUN apt-get install -y wget libmozjs-24-bin
RUN update-alternatives --install /usr/bin/js js /usr/bin/js24 100
@@ -21,5 +20,5 @@ CMD /start
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

View File

@@ -2,28 +2,41 @@ This docker image provides a Minecraft Server that will automatically download t
To simply use the latest stable version, run
docker run -d -p 25565:25565 minecraft-server
docker run -d -p 25565:25565 itzg/minecraft-server
where the default server port, 25565, will be exposed on your host machine.
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
Mojang now requires accepting the [Minecraft EULA](https://account.mojang.com/documents/minecraft_eula). To accept add
docker run -d -v /path/on/host:/data -p 25565:25565 minecraft-server
-e EULA=TRUE
such as
docker run -e EULA=TRUE -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,
docker run -d -v /path/on/host:/data -p 25565:25565 itzg/minecraft-server
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
or a specific version:
docker run -d -e VERSION=1.7.9 -p 25565:25565 minecraft-server
* LATEST
* SNAPSHOT
* (or a specific version, such as "1.7.9")
For example, to use the latest snapshot:
docker run -d -e VERSION=SNAPSHOT ...
or a specific version:
docker run -d -e VERSION=1.7.9 ...
The message of the day, shown below each server entry in the UI, can be changed with the `MOTD` environment variable, such as
docker run -d -e 'MOTD=My Server' ...
docker run -d -e 'MOTD=My Server' -p 25565:25565 minecraft-server
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' ...

View File

@@ -13,7 +13,8 @@ esac
cd /data
if [ ! -e minecraft_server.$VERSION.jar ]; then
wget https://s3.amazonaws.com/Minecraft.Download/versions/$VERSION/minecraft_server.$VERSION.jar
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
@@ -23,4 +24,19 @@ fi
sed -i "/motd\s*=/ c motd=$MOTD" /data/server.properties
sed -i "/level-name\s*=/ c level-name=$LEVEL" /data/server.properties
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

View File

@@ -2,7 +2,7 @@ FROM ubuntu:trusty
MAINTAINER itzg
ENV APT_GET_UPDATE 2014-07-19
ENV APT_GET_UPDATE 2014-09-07
RUN apt-get update
RUN apt-get install -y openjdk-7-jre-headless