Compare commits

...

10 Commits

Author SHA1 Message Date
Geoff Bourne
07c32d8ee4 [mc] Fixed TYPE=FORGE for alpine base image
For #128
2017-02-28 18:32:15 -06:00
Geoff Bourne
2e631bcbd9 [es] Upgrade to 5.2.2 2017-02-28 18:12:29 -06:00
Geoff Bourne
c96c630fe5 Merged branch master into master 2017-02-22 16:49:21 -06:00
Geoff Bourne
f69e75cfc1 [mc] Add rcon to big composition 2017-02-22 16:49:08 -06:00
Geoff Bourne
6157a693f1 Merge pull request #115 from ikke-t/alpine
Switch to Alpine linux for container base
2017-02-22 13:23:06 -06:00
Geoff Bourne
854a158d3d Merge branch 'master' into alpine 2017-02-22 13:16:38 -06:00
Geoff Bourne
18919ef33c [mc] Upgrade to Alpine compatible restify 2017-02-22 13:14:48 -06:00
Ilkka Tengvall
2d8b3d7275 Remove commented lines 2016-12-07 19:10:18 +02:00
Ilkka Tengvall
f48eedee78 restored the java heap size
I reduced it for RasPi, but forgot it low here too. Restored.
2016-12-07 19:06:01 +02:00
Ilkka Tengvall
08d459c373 changed to work on alpine container 2016-12-07 00:31:06 +02:00
5 changed files with 40 additions and 29 deletions

View File

@@ -4,7 +4,7 @@ MAINTAINER itzg
RUN apk -U add bash RUN apk -U add bash
ENV ES_VERSION=5.2.1 ENV ES_VERSION=5.2.2
ADD https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-$ES_VERSION.tar.gz /tmp/es.tgz ADD https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-$ES_VERSION.tar.gz /tmp/es.tgz
RUN cd /usr/share && \ RUN cd /usr/share && \

View File

@@ -1,30 +1,32 @@
FROM openjdk:8-jre FROM alpine
MAINTAINER itzg MAINTAINER itzg
ENV APT_GET_UPDATE 2016-04-23 RUN echo "http://dl-3.alpinelinux.org/alpine/v3.5/community/" >> /etc/apk/repositories &&\
RUN apt-get update apk update && \
apk add \
openjdk8-jre-base \
openssl \
imagemagick \
lsof \
su-exec \
bash \
git \
jq &&\
rm -rf /var/cache/apk/*
RUN DEBIAN_FRONTEND=noninteractive apt-get install -y \ RUN addgroup -g 1000 minecraft \
imagemagick \ && adduser -Ss /bin/false -u 1000 -G minecraft -h /home/minecraft minecraft \
lsof \
nano \
sudo \
vim \
jq \
&& apt-get clean
RUN useradd -s /bin/false --uid 1000 minecraft \
&& mkdir /data \ && mkdir /data \
&& mkdir /config \ && mkdir /config \
&& mkdir /mods \ && mkdir /mods \
&& mkdir /plugins \ && mkdir /plugins \
&& mkdir /home/minecraft \
&& chown minecraft:minecraft /data /config /mods /plugins /home/minecraft && chown minecraft:minecraft /data /config /mods /plugins /home/minecraft
EXPOSE 25565 25575 EXPOSE 25565 25575
ADD https://github.com/itzg/restify/releases/download/1.0.3/restify_linux_amd64 /usr/local/bin/restify ADD https://github.com/itzg/restify/releases/download/1.0.4/restify_linux_amd64 /usr/local/bin/restify
COPY start.sh /start COPY start.sh /start
COPY start-minecraft.sh /start-minecraft COPY start-minecraft.sh /start-minecraft
COPY mcadmin.jq /usr/share COPY mcadmin.jq /usr/share

View File

@@ -1,9 +1,9 @@
version: '3' version: '3'
services: services:
minecraft-server: minecraft:
ports: ports:
- "25570:25565" - "25565:25565"
volumes: volumes:
- "mcbig:/data" - "mcbig:/data"
environment: environment:
@@ -16,6 +16,14 @@ services:
CONSOLE: "false" CONSOLE: "false"
image: itzg/minecraft-server image: itzg/minecraft-server
restart: always restart: always
rcon:
image: itzg/rcon
ports:
- "4326:4326"
- "4327:4327"
volumes:
- "rcon:/opt/rcon-web-admin/db"
volumes: volumes:
mcbig: mcbig:
rcon:

View File

@@ -23,16 +23,16 @@ VERSIONS_JSON=https://launchermeta.mojang.com/mc/game/version_manifest.json
echo "Checking version information." echo "Checking version information."
case "X$VERSION" in case "X$VERSION" in
X|XLATEST|Xlatest) X|XLATEST|Xlatest)
VANILLA_VERSION=`curl -sSL $VERSIONS_JSON | jq -r '.latest.release'` VANILLA_VERSION=`wget -O - -q $VERSIONS_JSON | jq -r '.latest.release'`
;; ;;
XSNAPSHOT|Xsnapshot) XSNAPSHOT|Xsnapshot)
VANILLA_VERSION=`curl -sSL $VERSIONS_JSON | jq -r '.latest.snapshot'` VANILLA_VERSION=`wget -O - -q $VERSIONS_JSON | jq -r '.latest.snapshot'`
;; ;;
X[1-9]*) X[1-9]*)
VANILLA_VERSION=$VERSION VANILLA_VERSION=$VERSION
;; ;;
*) *)
VANILLA_VERSION=`curl -sSL $VERSIONS_JSON | jq -r '.latest.release'` VANILLA_VERSION=`wget -O - -q $VERSIONS_JSON | jq -r '.latest.release'`
;; ;;
esac esac
@@ -120,7 +120,7 @@ function installForge {
echo "Checking Forge version information." echo "Checking Forge version information."
case $FORGEVERSION in case $FORGEVERSION in
RECOMMENDED) RECOMMENDED)
curl -o /tmp/forge.json -sSL http://files.minecraftforge.net/maven/net/minecraftforge/forge/promotions_slim.json wget -q -O /tmp/forge.json http://files.minecraftforge.net/maven/net/minecraftforge/forge/promotions_slim.json
FORGE_VERSION=$(cat /tmp/forge.json | jq -r ".promos[\"$norm-recommended\"]") FORGE_VERSION=$(cat /tmp/forge.json | jq -r ".promos[\"$norm-recommended\"]")
if [ $FORGE_VERSION = null ]; then if [ $FORGE_VERSION = null ]; then
FORGE_VERSION=$(cat /tmp/forge.json | jq -r ".promos[\"$norm-latest\"]") FORGE_VERSION=$(cat /tmp/forge.json | jq -r ".promos[\"$norm-latest\"]")
@@ -138,7 +138,7 @@ function installForge {
esac esac
# URL format changed for 1.7.10 from 10.13.2.1300 # 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) sorted=$( (echo $FORGE_VERSION; echo 10.13.2.1300) | sort | head -1)
if [[ $norm == '1.7.10' && $sorted == '10.13.2.1300' ]]; then if [[ $norm == '1.7.10' && $sorted == '10.13.2.1300' ]]; then
# if $FORGEVERSION >= 10.13.2.1300 # if $FORGEVERSION >= 10.13.2.1300
normForgeVersion="$norm-$FORGE_VERSION-$norm" normForgeVersion="$norm-$FORGE_VERSION-$norm"
@@ -363,7 +363,7 @@ if [ ! -e server.properties ]; then
if [ -n "$LEVEL_TYPE" ]; then if [ -n "$LEVEL_TYPE" ]; then
# normalize to uppercase # normalize to uppercase
LEVEL_TYPE=${LEVEL_TYPE^^} LEVEL_TYPE=$( echo ${LEVEL_TYPE} | tr '[:lower:]' '[:upper:]' )
echo "Setting level type to $LEVEL_TYPE" echo "Setting level type to $LEVEL_TYPE"
# check for valid values and only then set # check for valid values and only then set
case $LEVEL_TYPE in case $LEVEL_TYPE in
@@ -402,7 +402,8 @@ if [ ! -e server.properties ]; then
if [ -n "$MODE" ]; then if [ -n "$MODE" ]; then
echo "Setting mode" echo "Setting mode"
case ${MODE,,?} in MODE_LC=$( echo $MODE | tr '[:upper:]' '[:lower:]' )
case $MODE_LC in
0|1|2|3) 0|1|2|3)
;; ;;
su*) su*)

View File

@@ -1,13 +1,13 @@
#!/bin/sh #!/bin/sh
set -e set -e
usermod --uid $UID minecraft sed -i "/^minecraft/s/1000/${UID}/g" /etc/passwd
groupmod --gid $GID minecraft sed -i "/^minecraft/s/1000/${GID}/g" /etc/group
if [ "$SKIP_OWNERSHIP_FIX" != "TRUE" ]; then if [ "$SKIP_OWNERSHIP_FIX" != "TRUE" ]; then
fix_ownership() { fix_ownership() {
dir=$1 dir=$1
if ! sudo -u minecraft test -w $dir; then if ! su-exec minecraft test -w $dir; then
echo "Correcting writability of $dir ..." echo "Correcting writability of $dir ..."
chown -R minecraft:minecraft $dir chown -R minecraft:minecraft $dir
chmod -R u+w $dir chmod -R u+w $dir
@@ -19,4 +19,4 @@ if [ "$SKIP_OWNERSHIP_FIX" != "TRUE" ]; then
fi fi
echo "Switching to user 'minecraft'" echo "Switching to user 'minecraft'"
exec sudo -E -u minecraft /start-minecraft "$@" su-exec minecraft /start-minecraft $@