diff --git a/Dockerfile b/Dockerfile index 2b3d213..bb19354 100644 --- a/Dockerfile +++ b/Dockerfile @@ -2,9 +2,7 @@ FROM ironcraft/minecraft-forge:1.10.2 MAINTAINER Xawirses LABEL maintainer="Xawirses " -VOLUME ["/minecraft/world", "/minecraft/config"] - -RUN apt update && apt install -y unzip zip +RUN apt update && apt install -y unzip zip wget python ENV AOE_VERSION 1.0.4 ENV AOE_URL https://addons-origin.cursecdn.com/files/2455/50/Age%20of%20Engineering-${AOE_VERSION}.zip @@ -12,9 +10,12 @@ ENV AOE_URL https://addons-origin.cursecdn.com/files/2455/50/Age%20of%20Engineer RUN curl --create-dirs -sLo /build/aoe.zip "${AOE_URL}" && \ cd /build && \ unzip aoe.zip -d /build/aoe && \ - cp -R /build/aoe/overrides/* /minecraft/ + cp -Rfv /build/aoe/overrides/* /minecraft/ + +COPY dl_mods.sh /build/dl_mods.sh +RUN chmod +x /build/dl_mods.sh && bash /build/dl_mods.sh +RUN rm -Rf /build EXPOSE 25565 - ENTRYPOINT ["/usr/bin/entrypoint.sh"] \ No newline at end of file diff --git a/README.md b/README.md index f873b89..9f3ddf9 100644 --- a/README.md +++ b/README.md @@ -5,10 +5,6 @@ These are docker images for [Age of Engineering](https://mods.curse.com/modpacks/minecraft/263897-age-of-engineering) [Minecraft](https://minecraft.net) Modpack power by [Minecraft Forge](http://www.minecraftforge.net/). -## Volumes -* /minecraft/world -* /minecraft/config - ## Ports * 25565 diff --git a/dl_mods.sh b/dl_mods.sh new file mode 100755 index 0000000..e6c3015 --- /dev/null +++ b/dl_mods.sh @@ -0,0 +1,23 @@ +#!/bin/bash + +function getJsonVal() { + python -c "import json,sys;sys.stdout.write(json.dumps(json.load(sys.stdin)$1))"; +} + +IFS=';' + +files=$(cat /build/aoe/manifest.json | getJsonVal "['files']") +files=${files//'}, {'/';'} +files=${files//'[{'/''} +files=${files//'}]'/''} + +for addr in $files +do + echo $addr + p=$(echo '{'$addr'}' | getJsonVal "['projectID']") + f=$(echo '{'$addr'}' | getJsonVal "['fileID']") + + if [ -n "$p" ]; then + wget https://minecraft.curseforge.com/projects/$p/files/$f/download -O /minecraft/mods/${p}_${f}.jar + fi +done