diff --git a/images/ubuntu/Dockerfile b/images/ubuntu/Dockerfile index f585919..50ae21f 100644 --- a/images/ubuntu/Dockerfile +++ b/images/ubuntu/Dockerfile @@ -4,10 +4,16 @@ MAINTAINER AshDev ENV DEBIAN_FRONTEND noninteractive RUN apt-get update -y; apt-get upgrade -y -RUN apt-get install -y software-properties-common +RUN apt-get install -y software-properties-common apt-utils RUN add-apt-repository ppa:webupd8team/java -y -RUN apt-get install -y curl openjdk-8-jdk supervisor pwgen -RUN apt-get update && apt-get install -y wget git && apt-get clean all +RUN apt-get install -y curl \ + openjdk-8-jdk \ + supervisor \ + pwgen \ + sudo \ + wget \ + git +RUN apt-get clean all ENV APP_NAME=server #default directory for SPIGOT-server diff --git a/images/ubuntu/lib/scripts/spigot_init.sh b/images/ubuntu/lib/scripts/spigot_init.sh index 6bc7498..b3cc986 100644 --- a/images/ubuntu/lib/scripts/spigot_init.sh +++ b/images/ubuntu/lib/scripts/spigot_init.sh @@ -1,6 +1,8 @@ #!/bin/bash set -e +echo "SPIGOT_HOME=$SPIGOT_HOME/" + # Change owner to minecraft. if [ "$SKIPCHMOD" != "true" ]; then sudo chown -R minecraft:minecraft $SPIGOT_HOME/ @@ -57,11 +59,20 @@ fi # Select the spigot.jar for this particular rev. rm -f $SPIGOT_HOME/spigot.jar && ln -s $SPIGOT_HOME/spigot-$REV.jar $SPIGOT_HOME/spigot.jar +# Avoid to be blacklisted by bukkit's cloudflare. Only redownload if asked. +if [ -z "$FORECEREBUILDBUKKIT" ]; then + REBUILD_BUKKIT=false +fi + # Install WorldBorder. if [ -n "$WORLDBORDER" ]; then if [ "$WORLDBORDER" = "true" ]; then - echo "Downloading WorldBorder..." - wget -O $SPIGOT_HOME/plugins/WorldBorder.jar https://dev.bukkit.org/projects/worldborder/files/latest + if [ ! -f $SPIGOT_HOME/plugins/WorldBorder.jar ] || [ "$REBUILD_BUKKIT" = "true" ]; then + echo "Downloading WorldBorder..." + wget -O $SPIGOT_HOME/plugins/WorldBorder.jar https://dev.bukkit.org/projects/worldborder/files/latest + else + echo "Using preiviously downloaded WorldBorder..." + fi else echo "Removing WorldBorder..." rm -f $SPIGOT_HOME/plugins/WorldBorder.jar @@ -119,8 +130,12 @@ fi # Install Clearlag. if [ -n "$CLEARLAG" ]; then if [ "$CLEARLAG" = "true" ]; then - echo "Downloading ClearLag..." - wget -O $SPIGOT_HOME/plugins/Clearlag.jar https://dev.bukkit.org/projects/clearlagg/files/latest + if [ ! -f $SPIGOT_HOME/plugins/Clearlag.jar ] || [ "$REBUILD_BUKKIT" = "true" ]; then + echo "Downloading ClearLag..." + wget -O $SPIGOT_HOME/plugins/Clearlag.jar https://dev.bukkit.org/projects/clearlagg/files/latest + else + echo "Using preiviously downloaded ClearLag..." + fi else echo "Removing Clearlag..." rm -f $SPIGOT_HOME/plugins/Clearlag.jar @@ -130,8 +145,12 @@ fi # Install PermissionsEx. if [ -n "$PERMISSIONSEX" ]; then if [ "$PERMISSIONSEX" = "true" ]; then - echo "Downloading PermissionsEx..." - wget -O $SPIGOT_HOME/plugins/PermissionsEx.jar https://dev.bukkit.org/projects/permissionsex/files/latest + if [ ! -f $SPIGOT_HOME/plugins/PermissionsEx.jar ] || [ "$REBUILD_BUKKIT" = "true" ]; then + echo "Downloading PermissionsEx..." + wget -O $SPIGOT_HOME/plugins/PermissionsEx.jar https://dev.bukkit.org/projects/permissionsex/files/latest + else + echo "Using preiviously downloaded PremissionsEx..." + fi else echo "Removing PermissionsEx..." rm -f $SPIGOT_HOME/plugins/PermissionsEx.jar