Compare commits

...

4 Commits

Author SHA1 Message Date
Geoff Bourne e5a4428515 [mc] Install iputils and wget for FTB compat 2017-09-24 11:46:47 -05:00
Geoff Bourne 6b9033318b [mc] For FTB pass-thru custom mod URLs
for #155
2017-09-03 20:20:25 -05:00
Geoff Bourne 9ee907783d [mc] Added issues link 2017-09-02 12:29:50 -05:00
Geoff Bourne 463cc62b75 [mc] Check writability of /data
Document JVM_OPTS
For #176 and #177
2017-09-02 12:24:09 -05:00
3 changed files with 31 additions and 11 deletions
+1 -1
View File
@@ -8,7 +8,7 @@ RUN apk add -U \
lsof \ lsof \
su-exec \ su-exec \
bash \ bash \
curl \ curl iputils wget \
git \ git \
jq \ jq \
mysql-client \ mysql-client \
+8 -1
View File
@@ -1,6 +1,7 @@
[![Docker Pulls](https://img.shields.io/docker/pulls/itzg/minecraft-server.svg)](https://hub.docker.com/r/itzg/minecraft-server/) [![Docker Pulls](https://img.shields.io/docker/pulls/itzg/minecraft-server.svg)](https://hub.docker.com/r/itzg/minecraft-server/)
[![Docker Stars](https://img.shields.io/docker/stars/itzg/minecraft-server.svg?maxAge=2592000)](https://hub.docker.com/r/itzg/minecraft-server/) [![Docker Stars](https://img.shields.io/docker/stars/itzg/minecraft-server.svg?maxAge=2592000)](https://hub.docker.com/r/itzg/minecraft-server/)
[![GitHub Issues](https://img.shields.io/github/issues-raw/itzg/dockerfiles.svg)](https://github.com/itzg/dockerfiles/issues)
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
version at startup. You can also run/upgrade to any specific version or the version at startup. You can also run/upgrade to any specific version or the
@@ -683,7 +684,7 @@ To use this option pass the environment variable `REMOVE_OLD_MODS="TRUE"`, such
**NOTE:** This option will be taken into account only when option `MODPACK` is also used. **NOTE:** This option will be taken into account only when option `MODPACK` is also used.
**WARNING:** All content of the `mods` or `plugins` directory will be deleted **WARNING:** All content of the `mods` or `plugins` directory will be deleted
before unpacking new content from the zip file. before unpacking new content from the zip file.
### Online mode ### Online mode
@@ -710,3 +711,9 @@ The values of all three are passed directly to the JVM and support format/units
### /data ownership ### /data ownership
In order to adapt to differences in `UID` and `GID` settings the entry script will attempt to correct ownership and writability of the `/data` directory. This logic can be disabled by setting `-e SKIP_OWNERSHIP_FIX=TRUE`. In order to adapt to differences in `UID` and `GID` settings the entry script will attempt to correct ownership and writability of the `/data` directory. This logic can be disabled by setting `-e SKIP_OWNERSHIP_FIX=TRUE`.
### JVM Options
General JVM options can be passed to the Minecraft Server invocation by passing a `JVM_OPTS`
environment variable. Options like `-X` that need to proceed general JVM options can be passed
via a `JVM_XX_OPTS` environment variable.
+22 -9
View File
@@ -9,6 +9,10 @@ if [ ! -e /data/eula.txt ]; then
if [ "$EULA" != "" ]; then if [ "$EULA" != "" ]; then
echo "# Generated via Docker on $(date)" > eula.txt echo "# Generated via Docker on $(date)" > eula.txt
echo "eula=$EULA" >> eula.txt echo "eula=$EULA" >> eula.txt
if [ $? != 0 ]; then
echo "ERROR: unable to write eula to /data. Please make sure attached directory is writable by uid=${UID}"
exit 2
fi
else else
echo "" echo ""
echo "Please accept the Minecraft EULA at" echo "Please accept the Minecraft EULA at"
@@ -20,6 +24,11 @@ if [ ! -e /data/eula.txt ]; then
fi fi
fi fi
if ! touch /data/.verify_access; then
echo "ERROR: /data doesn't seem to be writable. Please make sure attached directory is writable by uid=${UID} "
exit 2
fi
SERVER_PROPERTIES=/data/server.properties SERVER_PROPERTIES=/data/server.properties
FTB_DIR=/data/FeedTheBeast FTB_DIR=/data/FeedTheBeast
VERSIONS_JSON=https://launchermeta.mojang.com/mc/game/version_manifest.json VERSIONS_JSON=https://launchermeta.mojang.com/mc/game/version_manifest.json
@@ -261,16 +270,18 @@ function installFTB {
local srv_modpack=${FTB_SERVER_MOD} local srv_modpack=${FTB_SERVER_MOD}
if isURL ${srv_modpack}; then if isURL ${srv_modpack}; then
case $srv_modpack in case $srv_modpack in
*/download) https://www.feed-the-beast.com/*/download)
break;; break;;
*) https://www.feed-the-beast.com/*)
srv_modpack=${srv_modpack}/download;; srv_modpack=${srv_modpack}/download;;
esac esac
local file=$(basename $(dirname $srv_modpack)) local file=$(basename $(dirname $srv_modpack))
local downloaded=/data/${file}.zip local downloaded=/data/${file}.zip
echo "Downloading FTB modpack... if [ ! -e $downloaded ]; then
echo "Downloading FTB modpack...
$srv_modpack -> $downloaded" $srv_modpack -> $downloaded"
curl -sSL -o $downloaded $srv_modpack curl -sSL -o $downloaded $srv_modpack
fi
srv_modpack=$downloaded srv_modpack=$downloaded
fi fi
if [[ ${srv_modpack:0:5} == "data/" ]]; then if [[ ${srv_modpack:0:5} == "data/" ]]; then
@@ -291,10 +302,12 @@ function installFTB {
exit 2 exit 2
fi fi
echo "Unpacking FTB server modpack ${srv_modpack} ..." if [ ! -d ${FTB_DIR} ]; then
mkdir -p ${FTB_DIR} echo "Unpacking FTB server modpack ${srv_modpack} ..."
unzip -o ${srv_modpack} -d ${FTB_DIR} mkdir -p ${FTB_DIR}
cp -f /data/eula.txt ${FTB_DIR}/eula.txt unzip -o ${srv_modpack} -d ${FTB_DIR}
cp -f /data/eula.txt ${FTB_DIR}/eula.txt
fi
FTB_SERVER_START=${FTB_DIR}/ServerStart.sh FTB_SERVER_START=${FTB_DIR}/ServerStart.sh
chmod a+x ${FTB_SERVER_START} chmod a+x ${FTB_SERVER_START}
sed -i "s/-jar/-Dfml.queryResult=confirm -jar/" ${FTB_SERVER_START} sed -i "s/-jar/-Dfml.queryResult=confirm -jar/" ${FTB_SERVER_START}
@@ -637,7 +650,7 @@ if [[ ${TYPE} == "FEED-THE-BEAST" ]]; then
cp -f /data/{eula,ops,white-list}.txt ${FTB_DIR}/ cp -f /data/{eula,ops,white-list}.txt ${FTB_DIR}/
cd ${FTB_DIR} cd ${FTB_DIR}
echo "Running FTB server modpack start ..." echo "Running FTB server modpack start ..."
exec sh ${FTB_SERVER_START} exec ${FTB_SERVER_START}
else else
# If we have a bootstrap.txt file... feed that in to the server stdin # If we have a bootstrap.txt file... feed that in to the server stdin
if [ -f /data/bootstrap.txt ]; if [ -f /data/bootstrap.txt ];