mirror of
https://github.com/itzg/docker-minecraft-server
synced 2024-12-13 05:42:28 +00:00
[mc] Adding MODPACK download option similar to WORLD
This commit is contained in:
parent
16b3f18400
commit
9fa27b9a3d
3 changed files with 31 additions and 1 deletions
|
@ -36,4 +36,4 @@ ENV UID=1000
|
||||||
ENV MOTD A Minecraft Server Powered by Docker
|
ENV MOTD A Minecraft Server Powered by Docker
|
||||||
ENV JVM_OPTS -Xmx1024M -Xms1024M
|
ENV JVM_OPTS -Xmx1024M -Xms1024M
|
||||||
ENV TYPE=VANILLA VERSION=LATEST FORGEVERSION=RECOMMENDED LEVEL=world PVP=true DIFFICULTY=easy \
|
ENV TYPE=VANILLA VERSION=LATEST FORGEVERSION=RECOMMENDED LEVEL=world PVP=true DIFFICULTY=easy \
|
||||||
LEVEL_TYPE=DEFAULT GENERATOR_SETTINGS= WORLD=
|
LEVEL_TYPE=DEFAULT GENERATOR_SETTINGS= WORLD= MODPACK=
|
||||||
|
|
|
@ -301,6 +301,17 @@ will be deleted when the container is deleted.
|
||||||
you should use an IP address or a globally resolveable FQDN, or else the
|
you should use an IP address or a globally resolveable FQDN, or else the
|
||||||
name of a linked container.
|
name of a linked container.
|
||||||
|
|
||||||
|
### Downloadable mod pack
|
||||||
|
|
||||||
|
Like the `WORLD` option above, you can specify the URL of a "mod pack"
|
||||||
|
to download and install into the `mods` directory. To use this option
|
||||||
|
pass the environment variable `MODPACK`, such as
|
||||||
|
|
||||||
|
docker run -d -e MODPACK=http://www.example.com/mods/modpack.zip ...
|
||||||
|
|
||||||
|
**NOTE:** The referenced URL must be a zip file with one or more Forge jar files at the
|
||||||
|
top level of the zip archive.
|
||||||
|
|
||||||
## JVM Configuration
|
## JVM Configuration
|
||||||
|
|
||||||
### Memory Limit
|
### Memory Limit
|
||||||
|
|
|
@ -90,6 +90,7 @@ case "$TYPE" in
|
||||||
esac
|
esac
|
||||||
|
|
||||||
# If supplied with a URL for a world, download it and unpack
|
# If supplied with a URL for a world, download it and unpack
|
||||||
|
if [[ "$WORLD" ]]; then
|
||||||
case "X$WORLD" in
|
case "X$WORLD" in
|
||||||
X[Hh][Tt][Tt][Pp]*[Zz][iI][pP])
|
X[Hh][Tt][Tt][Pp]*[Zz][iI][pP])
|
||||||
echo "Downloading world via HTTP"
|
echo "Downloading world via HTTP"
|
||||||
|
@ -113,6 +114,24 @@ case "X$WORLD" in
|
||||||
echo "Invalid URL given for world: Must be HTTP or HTTPS and a ZIP file"
|
echo "Invalid URL given for world: Must be HTTP or HTTPS and a ZIP file"
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
fi
|
||||||
|
|
||||||
|
# If supplied with a URL for a modpack (simple zip of jars), download it and unpack
|
||||||
|
if [[ "$MODPACK" ]]; then
|
||||||
|
case "X$MODPACK" in
|
||||||
|
X[Hh][Tt][Tt][Pp]*[Zz][iI][pP])
|
||||||
|
echo "Downloading mod pack via HTTP"
|
||||||
|
echo "$MODPACK"
|
||||||
|
mkdir -p /data/mods
|
||||||
|
wget -q -O /tmp/modpack.zip "$MODPACK"
|
||||||
|
unzip -d /data/mods /tmp/modpack.zip
|
||||||
|
rm -f /tmp/modpack.zip
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
echo "Invalid URL given for modpack: Must be HTTP or HTTPS and a ZIP file"
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
fi
|
||||||
|
|
||||||
if [ ! -e server.properties ]; then
|
if [ ! -e server.properties ]; then
|
||||||
cp /tmp/server.properties .
|
cp /tmp/server.properties .
|
||||||
|
|
Loading…
Reference in a new issue