From d293a65f5e2ca5fc4615dcfe04e2a0ae3c9164c4 Mon Sep 17 00:00:00 2001 From: Geoff Bourne Date: Sat, 17 Aug 2019 14:40:51 -0500 Subject: [PATCH 01/19] Add MEMORY example Fixes #377 --- README.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 3329cf70..574cde65 100644 --- a/README.md +++ b/README.md @@ -1004,7 +1004,9 @@ ways to adjust the memory settings: * `MAX_MEMORY`, independently sets the max heap size The values of all three are passed directly to the JVM and support format/units as -`[g|G|m|M|k|K]`. +`[g|G|m|M|k|K]`. For example: + + -e MEMORY=2G ### JVM Options From 3c55a05b1c75ba7fa2345c7c10ba54c5d9676fe9 Mon Sep 17 00:00:00 2001 From: DocQuantum Date: Sat, 24 Aug 2019 10:38:59 -0500 Subject: [PATCH 02/19] Added ability to add resource-pack from environment vars (#379) --- Dockerfile | 1 + README.md | 10 +++++++++- start-finalSetup04ServerProperties | 2 ++ 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 7632a050..14946d25 100644 --- a/Dockerfile +++ b/Dockerfile @@ -61,6 +61,7 @@ ENV UID=1000 GID=1000 \ JVM_XX_OPTS="-XX:+UseG1GC" MEMORY="1G" \ TYPE=VANILLA VERSION=LATEST FORGEVERSION=RECOMMENDED SPONGEBRANCH=STABLE SPONGEVERSION= FABRICVERSION=LATEST LEVEL=world \ PVP=true DIFFICULTY=easy ENABLE_RCON=true RCON_PORT=25575 RCON_PASSWORD=minecraft \ + RESOURCE_PACK= RESOURCE_PACK_SHA1= \ LEVEL_TYPE=DEFAULT GENERATOR_SETTINGS= WORLD= MODPACK= MODS= SERVER_PORT=25565 ONLINE_MODE=TRUE CONSOLE=true SERVER_NAME="Dedicated Server" \ REPLACE_ENV_VARIABLES="FALSE" ENV_VARIABLE_PREFIX="CFG_" diff --git a/README.md b/README.md index 574cde65..2930939a 100644 --- a/README.md +++ b/README.md @@ -894,6 +894,14 @@ For example (just the `-e` bits): -e LEVEL_TYPE=flat -e 'GENERATOR_SETTINGS=3;minecraft:bedrock,3*minecraft:stone,52*minecraft:sandstone;2;' +### Custom Server Resource Pack + +You can set a link to a custom resource pack and set it's checksum using the `RESOURCE_PACK` and `RESOURCE_PACK_SHA1` options respectively, the default is blank: + + docker run -d -e 'RESROUCE_PACK=http\://link.com/to/pack.zip?\=1' -e 'RESOURCE_PACK_SHA1=d5db29cd03a2ed055086cef9c31c252b4587d6d0' + +**NOTE:** `:` and `=` must be escaped using `\`. The checksum plain-text hexadecimal. + ### World Save Name You can either switch between world saves or run multiple containers with different saves by using the `LEVEL` option, @@ -1033,4 +1041,4 @@ pass that at the end of `docker run` after the image name or set `-e CONSOLE=FAL ### Explicitly disable GUI Some older servers get confused and think that the GUI interface is enabled. You can explicitly -disable that by passing `-e GUI=FALSE`. \ No newline at end of file +disable that by passing `-e GUI=FALSE`. diff --git a/start-finalSetup04ServerProperties b/start-finalSetup04ServerProperties index 0f2e7580..a3815e67 100644 --- a/start-finalSetup04ServerProperties +++ b/start-finalSetup04ServerProperties @@ -70,6 +70,8 @@ function customizeServerProps { setServerProp "online-mode" "$ONLINE_MODE" setServerProp "allow-flight" "$ALLOW_FLIGHT" setServerProp "level-type" "${LEVEL_TYPE^^}" + setServerProp "resource-pack" "$RESOURCE_PACK" + setServerProp "resource-pack-sha1" "$RESOURCE_PACK_SHA1" if [ -n "$DIFFICULTY" ]; then case $DIFFICULTY in From 8e148095f0a4a902855ce134ed439c37a90c2833 Mon Sep 17 00:00:00 2001 From: Geoff Bourne Date: Sat, 24 Aug 2019 11:12:41 -0500 Subject: [PATCH 03/19] Adding link for github README --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 2930939a..c48b6ab8 100644 --- a/README.md +++ b/README.md @@ -9,6 +9,8 @@ This docker image provides a Minecraft Server that will automatically download t version at startup. You can also run/upgrade to any specific version or the latest snapshot. See the *Versions* section below for more information. +[![Click for more docs](https://i.imgur.com/jS02ebD.png)](https://github.com/itzg/docker-minecraft-server/blob/master/README.md) + To simply use the latest stable version, run docker run -d -p 25565:25565 --name mc itzg/minecraft-server From 5c238af3df31a63d207098ae1cc414aada5891df Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aur=C3=A9lien=20Bertron?= Date: Sun, 8 Sep 2019 23:40:45 +0200 Subject: [PATCH 04/19] Add spawn protection setting (#386) --- README.md | 6 ++++++ start-finalSetup04ServerProperties | 1 + 2 files changed, 7 insertions(+) diff --git a/README.md b/README.md index c48b6ab8..4c7b762e 100644 --- a/README.md +++ b/README.md @@ -823,6 +823,12 @@ Determines if monsters will be spawned. Determines if villagers will be spawned. docker run -d -e SPAWN_NPCS=true + +### Set spawn protection + +Sets the area that non-ops can not edit (0 to disable) + + docker run -d -e SPAWN_PROTECTION=0 ### View Distance Sets the amount of world data the server sends the client, measured in chunks in each direction of the player (radius, not diameter). diff --git a/start-finalSetup04ServerProperties b/start-finalSetup04ServerProperties index a3815e67..b9df16e8 100644 --- a/start-finalSetup04ServerProperties +++ b/start-finalSetup04ServerProperties @@ -49,6 +49,7 @@ function customizeServerProps { setServerProp "spawn-animals" "$SPAWN_ANIMALS" setServerProp "spawn-monsters" "$SPAWN_MONSTERS" setServerProp "spawn-npcs" "$SPAWN_NPCS" + setServerProp "spawn-protection" "$SPAWN_PROTECTION" setServerProp "generate-structures" "$GENERATE_STRUCTURES" setServerProp "view-distance" "$VIEW_DISTANCE" setServerProp "hardcore" "$HARDCORE" From 621962ad9c044925eb6057910b343c515cf67d53 Mon Sep 17 00:00:00 2001 From: Geoff Bourne Date: Sun, 8 Sep 2019 17:22:02 -0500 Subject: [PATCH 05/19] Always populate ops.txt to allow for additive config For #283 --- start-minecraftFinalSetup | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/start-minecraftFinalSetup b/start-minecraftFinalSetup index d848c6d4..bf75a53f 100644 --- a/start-minecraftFinalSetup +++ b/start-minecraftFinalSetup @@ -2,9 +2,10 @@ . /start-utils -if [ -n "$OPS" -a ! -e ops.txt.converted ]; then - echo "Setting ops" - echo $OPS | awk -v RS=, '{print}' >> ops.txt +if [ -n "$OPS" ]; then + echo "Setting/adding ops" + rm -rf ops.txt.converted + echo $OPS | awk -v RS=, '{print}' > ops.txt fi if [ -n "$WHITELIST" -a ! -e white-list.txt.converted ]; then From 8859d223bfc30c41e93bbadeb7dc9fb882afb6b5 Mon Sep 17 00:00:00 2001 From: Geoff Bourne Date: Sat, 14 Sep 2019 22:29:54 -0500 Subject: [PATCH 06/19] Track Minecraft version also in Fabric install marker For #361 --- start-deployFabric | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/start-deployFabric b/start-deployFabric index 68b9d38b..e9ad8394 100644 --- a/start-deployFabric +++ b/start-deployFabric @@ -28,7 +28,7 @@ elif [[ ! -e $FABRIC_INSTALLER ]]; then exit 2 fi -installMarker=".fabric-installed-${FABRIC_VERSION:-manual}" +installMarker=".fabric-installed-${VANILLA_VERSION}-${FABRIC_VERSION:-manual}" if [[ ! -e $installMarker ]]; then if [[ ! -e $FABRIC_INSTALLER ]]; then From 401958c0d615c5992bbc5b635da99b6d743b7b33 Mon Sep 17 00:00:00 2001 From: Geoff Bourne Date: Sun, 15 Sep 2019 09:54:13 -0500 Subject: [PATCH 07/19] Add debugs for Fabric setup For #361 --- start-deployFabric | 11 +++++++++-- start-utils | 2 +- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/start-deployFabric b/start-deployFabric index e9ad8394..13ace55b 100644 --- a/start-deployFabric +++ b/start-deployFabric @@ -1,5 +1,7 @@ #!/bin/bash -set -u +set -eu + +. /start-utils export TYPE=FABRIC @@ -30,6 +32,7 @@ fi installMarker=".fabric-installed-${VANILLA_VERSION}-${FABRIC_VERSION:-manual}" +debug Checking for installMarker ${installMarker} if [[ ! -e $installMarker ]]; then if [[ ! -e $FABRIC_INSTALLER ]]; then if [[ -z $FABRIC_INSTALLER_URL ]]; then @@ -46,7 +49,11 @@ if [[ ! -e $installMarker ]]; then fi fi - echo "Installing Fabric $FABRIC_VERSION using $FABRIC_INSTALLER" + if isDebugging; then + debug "Installing Fabric $FABRIC_VERSION using $FABRIC_INSTALLER with mcversion ${VANILLA_VERSION}" + else + echo "Installing Fabric $FABRIC_VERSION using $FABRIC_INSTALLER" + fi tries=3 set +e while ((--tries >= 0)); do diff --git a/start-utils b/start-utils index 13a29971..8a2cd621 100644 --- a/start-utils +++ b/start-utils @@ -28,7 +28,7 @@ function isTrue { } function isDebugging { - if [[ ${DEBUG^^} = TRUE ]]; then + if [[ -v DEBUG ]] && [[ ${DEBUG^^} = TRUE ]]; then return 0 else return 1 From 62a4541df5d28e8d986763a709ba2c91141b55b3 Mon Sep 17 00:00:00 2001 From: Geoff Bourne Date: Sun, 15 Sep 2019 14:09:27 -0500 Subject: [PATCH 08/19] Fix upgrade support for Paper For #361 --- start-deployPaper | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/start-deployPaper b/start-deployPaper index b1c47c34..aac76d30 100644 --- a/start-deployPaper +++ b/start-deployPaper @@ -1,11 +1,11 @@ #!/bin/bash -export SERVER=paper_server.jar -if [ ! -f $SERVER ] || [ -n "$FORCE_REDOWNLOAD" ]; then +export SERVER=paper_server-${VANILLA_VERSION}.jar +if [ ! -f "$SERVER" ] || [ -n "$FORCE_REDOWNLOAD" ]; then downloadUrl=${PAPER_DOWNLOAD_URL:-https://papermc.io/api/v1/paper/${VANILLA_VERSION}/latest/download} echo "Downloading Paper $VANILLA_VERSION from $downloadUrl ..." - curl -fsSL -o $SERVER "$downloadUrl" - if [ ! -f $SERVER ]; then + curl -fsSL -o "$SERVER" "$downloadUrl" + if [ ! -f "$SERVER" ]; then echo "ERROR: failed to download from $downloadUrl (status=$?)" exit 3 fi From 34d4ae0b59cdc50660e4e980b565d3f8d2ad2d8b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Richter?= <2268851+x3rAx@users.noreply.github.com> Date: Mon, 16 Sep 2019 00:15:33 +0200 Subject: [PATCH 09/19] Only write EULA when it's set to `TRUE` (#387) * Only write EULA when it's set to `TRUE` - This prevents a false value to be written while not being able to correct it afterwards using the environment variable. * Convert EULA value to upper case to allow lower case `true` as value --- start-configuration | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/start-configuration b/start-configuration index 8581d7ec..58ef75fd 100644 --- a/start-configuration +++ b/start-configuration @@ -6,14 +6,8 @@ shopt -s nullglob export HOME=/data if [ ! -e /data/eula.txt ]; then - if [ "$EULA" != "" ]; then - echo "# Generated via Docker on $(date)" > 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 + EULA="${EULA^^}" + if [ "$EULA" != "TRUE" ]; then echo "" echo "Please accept the Minecraft EULA at" echo " https://account.mojang.com/documents/minecraft_eula" @@ -22,8 +16,16 @@ if [ ! -e /data/eula.txt ]; then echo "" exit 1 fi + + echo "# Generated via Docker on $(date)" > 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 fi + echo "Running as uid=$(id -u) gid=$(id -g) with /data as '$(ls -lnd /data)'" if ! touch /data/.verify_access; then From 8924740cfe6606e6fadb3613e32ce31111ce8bf6 Mon Sep 17 00:00:00 2001 From: Geoff Bourne Date: Tue, 17 Sep 2019 21:06:29 -0500 Subject: [PATCH 10/19] Bump mc-server-runner to 1.3.3 to allow for 386 builds --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 14946d25..f5be3f2c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -33,7 +33,7 @@ RUN echo 'hosts: files dns' > /etc/nsswitch.conf ARG RESTIFY_VER=1.1.6 ARG RCON_CLI_VER=1.4.6 -ARG MC_SERVER_RUNNER_VER=1.3.2 +ARG MC_SERVER_RUNNER_VER=1.3.3 ARG ARCH=amd64 ADD https://github.com/itzg/restify/releases/download/${RESTIFY_VER}/restify_${RESTIFY_VER}_linux_${ARCH}.tar.gz /tmp/restify.tgz From e6f593e8c47d791a22eae19e7570e6f35bf2308d Mon Sep 17 00:00:00 2001 From: Geoff Bourne Date: Wed, 18 Sep 2019 21:14:08 -0500 Subject: [PATCH 11/19] Updating tools to support ARCH=386 builds --- Dockerfile | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/Dockerfile b/Dockerfile index f5be3f2c..6d2de61b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -31,22 +31,20 @@ EXPOSE 25565 25575 RUN echo 'hosts: files dns' > /etc/nsswitch.conf -ARG RESTIFY_VER=1.1.6 -ARG RCON_CLI_VER=1.4.6 -ARG MC_SERVER_RUNNER_VER=1.3.3 ARG ARCH=amd64 -ADD https://github.com/itzg/restify/releases/download/${RESTIFY_VER}/restify_${RESTIFY_VER}_linux_${ARCH}.tar.gz /tmp/restify.tgz -RUN tar -x -C /usr/local/bin -f /tmp/restify.tgz restify && \ - rm /tmp/restify.tgz +ARG EASY_ADD_VER=0.2.1 +ADD https://github.com/itzg/easy-add/releases/download/${EASY_ADD_VER}/easy-add_${EASY_ADD_VER}_linux_${ARCH} /usr/bin/easy-add +RUN chmod +x /usr/bin/easy-add -ADD https://github.com/itzg/rcon-cli/releases/download/${RCON_CLI_VER}/rcon-cli_${RCON_CLI_VER}_linux_${ARCH}.tar.gz /tmp/rcon-cli.tgz -RUN tar -x -C /usr/local/bin -f /tmp/rcon-cli.tgz rcon-cli && \ - rm /tmp/rcon-cli.tgz +ARG RESTIFY_VER=1.2.1 +RUN easy-add --file restify --from https://github.com/itzg/restify/releases/download/${RESTIFY_VER}/restify_${RESTIFY_VER}_linux_${ARCH}.tar.gz -ADD https://github.com/itzg/mc-server-runner/releases/download/${MC_SERVER_RUNNER_VER}/mc-server-runner_${MC_SERVER_RUNNER_VER}_linux_${ARCH}.tar.gz /tmp/mc-server-runner.tgz -RUN tar -x -C /usr/local/bin -f /tmp/mc-server-runner.tgz mc-server-runner && \ - rm /tmp/mc-server-runner.tgz +ARG RCON_CLI_VER=1.4.7 +RUN easy-add --file rcon-cli --from https://github.com/itzg/rcon-cli/releases/download/${RCON_CLI_VER}/rcon-cli_${RCON_CLI_VER}_linux_${ARCH}.tar.gz + +ARG MC_RUN_VER=1.3.3 +RUN easy-add --file mc-server-runner --from https://github.com/itzg/mc-server-runner/releases/download/${MC_RUN_VER}/mc-server-runner_${MC_RUN_VER}_linux_${ARCH}.tar.gz COPY mcadmin.jq /usr/share RUN chmod +x /usr/local/bin/* From 67fe8931dded434a22095de513ede0e98d2444b2 Mon Sep 17 00:00:00 2001 From: Geoff Bourne Date: Sun, 22 Sep 2019 16:40:54 -0500 Subject: [PATCH 12/19] Upgrade easy-add, which now logs to stdout --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 6d2de61b..06ad3018 100644 --- a/Dockerfile +++ b/Dockerfile @@ -33,7 +33,7 @@ RUN echo 'hosts: files dns' > /etc/nsswitch.conf ARG ARCH=amd64 -ARG EASY_ADD_VER=0.2.1 +ARG EASY_ADD_VER=0.3.0 ADD https://github.com/itzg/easy-add/releases/download/${EASY_ADD_VER}/easy-add_${EASY_ADD_VER}_linux_${ARCH} /usr/bin/easy-add RUN chmod +x /usr/bin/easy-add From 2900062df5caf77958863b6e9d57a17ba3152299 Mon Sep 17 00:00:00 2001 From: Geoff Bourne Date: Sun, 22 Sep 2019 16:48:59 -0500 Subject: [PATCH 13/19] Always update whitelist from env since it is processed additive anyway For #283 --- start-minecraftFinalSetup | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/start-minecraftFinalSetup b/start-minecraftFinalSetup index bf75a53f..ff5b4ca7 100644 --- a/start-minecraftFinalSetup +++ b/start-minecraftFinalSetup @@ -8,9 +8,10 @@ if [ -n "$OPS" ]; then echo $OPS | awk -v RS=, '{print}' > ops.txt fi -if [ -n "$WHITELIST" -a ! -e white-list.txt.converted ]; then +if [ -n "$WHITELIST" ]; then echo "Setting whitelist" - echo $WHITELIST | awk -v RS=, '{print}' >> white-list.txt + rm -rf white-list.txt.converted + echo $WHITELIST | awk -v RS=, '{print}' > white-list.txt fi if [ -n "$ICON" -a ! -e server-icon.png ]; then From b67580af2c681a2177e9b7d044827f0df27d91e1 Mon Sep 17 00:00:00 2001 From: Pavel Andreyev Date: Tue, 24 Sep 2019 19:22:00 +0400 Subject: [PATCH 14/19] Support .conf extension for config files (#388) * Support .conf extension for config files * Update the docs for env variables --- README.md | 3 +++ start-finalSetup05EnvVariables | 15 ++++++++++----- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 4c7b762e..bb95f1f1 100644 --- a/README.md +++ b/README.md @@ -240,6 +240,9 @@ There are some limitations to what characters you can use. | Name | `0-9a-zA-Z_-` | | Value | `0-9a-zA-Z_-:/=?.+` | +Variables will be replaced in files with the following extensions: +`.yml`, `.yaml`, `.txt`, `.cfg`, `.conf`, `.properties`. + Here is a full example where we want to replace values inside a `database.yml`. ```yml diff --git a/start-finalSetup05EnvVariables b/start-finalSetup05EnvVariables index d1c44f49..532e28e4 100644 --- a/start-finalSetup05EnvVariables +++ b/start-finalSetup05EnvVariables @@ -1,15 +1,20 @@ #!/bin/bash -if [ "$REPLACE_ENV_VARIABLES" = "TRUE" ]; then +if [ "${REPLACE_ENV_VARIABLES^^}" = "TRUE" ]; then echo "Replacing env variables in configs that match the prefix $ENV_VARIABLE_PREFIX..." while IFS='=' read -r name value ; do # check if name of env variable matches the prefix # sanity check environment variables to avoid code injections - if [[ "$name" = $ENV_VARIABLE_PREFIX* ]] && [[ $value =~ ^[0-9a-zA-Z_:/=?.+\-]*$ ]] && [[ $name =~ ^[0-9a-zA-Z_\-]*$ ]]; then - echo "Replacing $name with $value ..." - find /data/ -type f \( -name "*.yml" -or -name "*.yaml" -or -name "*.txt" -or -name "*.cfg" -or -name "*.properties" \) -exec sed -i 's#${'"$name"'}#'"$value"'#g' {} \; + if [[ "$name" = $ENV_VARIABLE_PREFIX* ]] \ + && [[ $value =~ ^[0-9a-zA-Z_:/=?.+\-]*$ ]] \ + && [[ $name =~ ^[0-9a-zA-Z_\-]*$ ]]; then + echo "Replacing $name with $value ..." + find /data/ -type f \ + \( -name "*.yml" -or -name "*.yaml" -or -name "*.txt" -or -name "*.cfg" \ + -or -name "*.conf" -or -name "*.properties" \) \ + -exec sed -i 's#${'"$name"'}#'"$value"'#g' {} \; fi done < <(env) fi -exec /start-minecraftFinalSetup $@ \ No newline at end of file +exec /start-minecraftFinalSetup $@ From 5ad745de75ff62e27854fc026be48b46793839ac Mon Sep 17 00:00:00 2001 From: Geoff Bourne Date: Sun, 29 Sep 2019 11:45:21 -0500 Subject: [PATCH 15/19] Initial support for GENERIC_PACK For #392 --- start-finalSetup02Modpack | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/start-finalSetup02Modpack b/start-finalSetup02Modpack index 25cd680d..782377c0 100644 --- a/start-finalSetup02Modpack +++ b/start-finalSetup02Modpack @@ -1,5 +1,9 @@ #!/bin/bash +set -e + +. /start-utils + # CURSE_URL_BASE used in manifest downloads below CURSE_URL_BASE=${CURSE_URL_BASE:-https://minecraft.curseforge.com/projects} @@ -106,4 +110,25 @@ case "X$EFFECTIVE_MANIFEST_URL" in esac fi +if [[ "${GENERIC_PACK}" ]]; then + if isURL "${GENERIC_PACK}"; then + generic_pack_url=${GENERIC_PACK} + GENERIC_PACK=/tmp/$(basename ${generic_pack_url}) + echo "Downloading generic pack from ${generic_pack_url} ..." + curl -fsSL -o ${GENERIC_PACK} ${generic_pack_url} + fi + + sum_file=/data/.generic_pack.sum + if ! sha256sum -c ${sum_file} -s 2> /dev/null; then + base_dir=/tmp/generic_pack_base + mkdir -p ${base_dir} + unzip -q -d ${base_dir} ${GENERIC_PACK} + depth=$(( ${GENERIC_PACK_STRIP_DIRS:-1} + 1 )) + echo "Applying generic pack, stripping $(( depth - 1 )) level ..." + find ${base_dir} -type d -mindepth $depth -maxdepth $depth -exec cp -r {} /data/ + + rm -rf ${base_dir} + sha256sum ${GENERIC_PACK} > ${sum_file} + fi +fi + exec /start-finalSetup03Modconfig $@ From d00f9d3609f3b40cf0cd1596e7a8dd4f185a3e2d Mon Sep 17 00:00:00 2001 From: Geoff Bourne Date: Tue, 1 Oct 2019 13:54:14 -0500 Subject: [PATCH 16/19] Normalize EULA value to lowercase to match Forge expectations For #394 --- start-configuration | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/start-configuration b/start-configuration index 58ef75fd..8f0555f7 100644 --- a/start-configuration +++ b/start-configuration @@ -6,8 +6,8 @@ shopt -s nullglob export HOME=/data if [ ! -e /data/eula.txt ]; then - EULA="${EULA^^}" - if [ "$EULA" != "TRUE" ]; then + EULA="${EULA,,}" + if [ "$EULA" != "true" ]; then echo "" echo "Please accept the Minecraft EULA at" echo " https://account.mojang.com/documents/minecraft_eula" From 15990071d400959aa985bdb6b655b8c7c22f9add Mon Sep 17 00:00:00 2001 From: jmyoung Date: Tue, 15 Oct 2019 02:54:26 +1030 Subject: [PATCH 17/19] Fixed JVM_XX_OPTS for FTB servers (#400) --- start-minecraftFinalSetup | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/start-minecraftFinalSetup b/start-minecraftFinalSetup index ff5b4ca7..4d0df79e 100644 --- a/start-minecraftFinalSetup +++ b/start-minecraftFinalSetup @@ -102,7 +102,7 @@ if [[ ${TYPE} == "FEED-THE-BEAST" ]]; then cat > "${FTB_DIR}/settings-local.sh" < Date: Wed, 13 Nov 2019 16:52:57 -0600 Subject: [PATCH 18/19] (improvement) Offsets healthcheck to T+1m (#397) --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 06ad3018..bf4a8549 100644 --- a/Dockerfile +++ b/Dockerfile @@ -20,7 +20,7 @@ RUN apk add --no-cache -U \ RUN pip install mcstatus yq -HEALTHCHECK CMD mcstatus localhost:$SERVER_PORT ping +HEALTHCHECK --start-period=1m CMD mcstatus localhost:$SERVER_PORT ping RUN addgroup -g 1000 minecraft \ && adduser -Ss /bin/false -u 1000 -G minecraft -h /home/minecraft minecraft \ From 135bafefeb2b79d650480b33d430f98e7c2bef0d Mon Sep 17 00:00:00 2001 From: Alexei Date: Sat, 16 Nov 2019 15:46:52 +0100 Subject: [PATCH 19/19] docker-versions-create init (#408) --- docker-versions-create.sh | 71 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 71 insertions(+) create mode 100755 docker-versions-create.sh diff --git a/docker-versions-create.sh b/docker-versions-create.sh new file mode 100755 index 00000000..8337ea85 --- /dev/null +++ b/docker-versions-create.sh @@ -0,0 +1,71 @@ +#!/bin/bash +#set -x +# Use this variable to indicate a list of branches that docker hub is watching +branches_list=('openj9' 'openj9-nightly') + +function TrapExit { + echo "Checking out back in master" + git checkout master +} + +trap TrapExit EXIT SIGTERM + +test -d ./.git || { echo ".git folder was not found. Please start this script from root directory of the project!"; + exit 1; } + +# Making sure we are in master +git checkout master +git pull --all || { echo "Can't pull the repo!"; \ + exit 1; } + +git_branches=$(git branch -a) + +for branch in "${branches_list[@]}"; do + if [[ "$git_branches" != *"$branch"* ]]; then + echo "Can't update $branch because I can't find it in the list of branches." + exit 1 + else + echo "Branch $branch found. Working with it." + git checkout "$branch" || { echo "Can't checkout into the branch. Don't know the cause."; \ + exit 1; } + proceed='False' + while [[ "$proceed" == "False" ]]; do + if git merge master; then + proceed="True" + echo "Branch $branch updated to current master successfully" + # pushing changes to remote for this branch + git commit -m "Auto merge branch with master" -a + # push may fail if remote doesn't have this branch yet. In this case - sending branch + git push || git push -u origin "$branch" || { echo "Can't push changes to the origin."; exit 1; } + else + cat<