diff --git a/.github/workflows/build-multiarch.yml b/.github/workflows/build-multiarch.yml index af52b673..d61203a9 100644 --- a/.github/workflows/build-multiarch.yml +++ b/.github/workflows/build-multiarch.yml @@ -3,8 +3,7 @@ on: push: branches: - master - - "*-multiarch" - - "multiarch*" + - java8-multiarch - java8-openj9 - java11* - java16* @@ -12,8 +11,7 @@ on: - test/* tags: - "[0-9]+.[0-9]+.[0-9]+" - - "[0-9]+.[0-9]+.[0-9]+-multiarch*" - - "[0-9]+.[0-9]+.[0-9]+-*multiarch" + - "[0-9]+.[0-9]+.[0-9]+-java8-multiarch" - "[0-9]+.[0-9]+.[0-9]+-java8-openj9" - "[0-9]+.[0-9]+.[0-9]+-java11*" - "[0-9]+.[0-9]+.[0-9]+-java16*" diff --git a/DEVELOPMENT.md b/DEVELOPMENT.md index 86df0d84..1b33d2e2 100644 --- a/DEVELOPMENT.md +++ b/DEVELOPMENT.md @@ -2,10 +2,10 @@ Adding a new server `TYPE` can vary due to the complexity of obtaining and configuring each type; however, the addition of any server type includes at least the following steps: -1. Copy an existing "start-deploy*" script, such as [start-deployMohist](start-deployMohist) and rename it accordingly making sure to retain the "start-deploy" prefix +1. Copy an existing "start-deploy*" script, such as [start-deployMohist](scripts/start-deployMohist) and rename it accordingly making sure to retain the "start-deploy" prefix 2. Modify the type-specific behavior between the "start-utils" preamble and the hand-off to `start-setupWorld` at the end of the script 3. Develop and test the changes using the [iterative process described below](#iterative-script-development) -4. Add a case-entry to the `case "${TYPE^^}"` in [start-configuration](start-configuration) +4. Add a case-entry to the `case "${TYPE^^}"` in [start-configuration](scripts/start-configuration) 5. Add a section to the [README](README.md). It is recommended to copy-modify an existing section to retain a similar wording and level of detail 6. [Submit a pull request](https://github.com/itzg/docker-minecraft-server/pulls) diff --git a/Dockerfile b/Dockerfile index 40fbe2d2..8a88f6d2 100644 --- a/Dockerfile +++ b/Dockerfile @@ -67,8 +67,6 @@ RUN curl -fsSL ${MC_HELPER_BASE_URL}/mc-image-helper-${MC_HELPER_VERSION}.tgz \ && ln -s /usr/share/mc-image-helper-${MC_HELPER_VERSION}/bin/mc-image-helper /usr/bin VOLUME ["/data"] -COPY server.properties /tmp/server.properties -COPY log4j2.xml /tmp/log4j2.xml WORKDIR /data STOPSIGNAL SIGTERM @@ -81,11 +79,12 @@ ENV UID=1000 GID=1000 \ ENABLE_AUTOPAUSE=false AUTOPAUSE_TIMEOUT_EST=3600 AUTOPAUSE_TIMEOUT_KN=120 AUTOPAUSE_TIMEOUT_INIT=600 \ AUTOPAUSE_PERIOD=10 AUTOPAUSE_KNOCK_INTERFACE=eth0 -COPY start* / +COPY scripts/start* / COPY bin/ /usr/local/bin/ COPY bin/mc-health /health.sh - -ADD files/autopause /autopause +COPY files/server.properties /tmp/server.properties +COPY files/log4j2.xml /tmp/log4j2.xml +COPY files/autopause /autopause RUN dos2unix /start* && chmod +x /start* \ && dos2unix /autopause/* && chmod +x /autopause/*.sh diff --git a/README.md b/README.md index 00a008c3..0d1a1bae 100644 --- a/README.md +++ b/README.md @@ -132,7 +132,7 @@ By default, the container will download the latest version of the "vanilla" [Min * [Enabling Autopause](#enabling-autopause) * [Running on RaspberryPi](#running-on-raspberrypi) - + @@ -280,7 +280,6 @@ To use a different version of Java, please use a docker tag to run your Minecraf | java16 | 16 | Debian | Hotspot | amd64,arm64,armv7 | | java16-openj9 | 16 | Debian | OpenJ9 | amd64 | | java17 | 17 | Ubuntu | Hotspot | amd64 | -| multiarch-latest | 15+ | Debian | Hotspot | amd64,arm64,armv7 | For example, to use Java version 16 on any supported architecture: @@ -295,6 +294,7 @@ The following image tags have been deprecated and are no longer receiving update - adopt14 - adopt15 - openj9-nightly +- multiarch-latest ## Healthcheck diff --git a/docker-versions-create.sh b/docker-versions-create.sh index 847efe8d..a68603e8 100755 --- a/docker-versions-create.sh +++ b/docker-versions-create.sh @@ -10,7 +10,6 @@ branches_list=( 'java16' 'java16-openj9' 'java17' - 'multiarch-latest' ) function TrapExit { diff --git a/Minecraft server containment.xml b/docs/Minecraft server containment.xml similarity index 100% rename from Minecraft server containment.xml rename to docs/Minecraft server containment.xml diff --git a/examples/docker-compose-ftba.yml b/examples/docker-compose-ftba.yml index 4976296d..5bf4d14b 100644 --- a/examples/docker-compose-ftba.yml +++ b/examples/docker-compose-ftba.yml @@ -3,7 +3,7 @@ version: "3.8" services: mc: # FTBA support is only available in non-Alpine images - image: itzg/minecraft-server:java8-multiarch + image: itzg/minecraft-server:${IMAGE_TAG:-java8-multiarch} ports: # expose the Minecraft server port outside of container - 25565:25565 @@ -14,10 +14,11 @@ services: TYPE: FTBA # Use Pack ID from https://ftb.neptunepowered.org/pack/ftb-presents-direwolf20-1-12/ FTB_MODPACK_ID: "31" + FTB_MODPACK_VERSION_ID: "" volumes: # use a named, managed volume for data volume - - mc_ftb:/data + - ftba:/data volumes: # declared the named volume, but use default/local storage engine - mc_ftb: {} + ftba: {} diff --git a/docker-compose.yml b/examples/docker-compose.yml similarity index 100% rename from docker-compose.yml rename to examples/docker-compose.yml diff --git a/log4j2.xml b/files/log4j2.xml similarity index 100% rename from log4j2.xml rename to files/log4j2.xml diff --git a/server.properties b/files/server.properties similarity index 100% rename from server.properties rename to files/server.properties diff --git a/minecraft-server/README.md b/minecraft-server/README.md deleted file mode 100644 index 1697907f..00000000 --- a/minecraft-server/README.md +++ /dev/null @@ -1,4 +0,0 @@ -# Moved to top-level - -The contents of this directory have now been moved to the top level of -[itzg/docker-minecraft-server](https://github.com/itzg/docker-minecraft-server). \ No newline at end of file diff --git a/start b/scripts/start similarity index 100% rename from start rename to scripts/start diff --git a/start-autopause b/scripts/start-autopause similarity index 100% rename from start-autopause rename to scripts/start-autopause diff --git a/start-configuration b/scripts/start-configuration similarity index 95% rename from start-configuration rename to scripts/start-configuration index f4f04c1e..d5651584 100755 --- a/start-configuration +++ b/scripts/start-configuration @@ -130,10 +130,6 @@ case "${TYPE^^}" in exec ${SCRIPTS:-/}start-deployCustom "$@" ;; - CURSE_INSTANCE) - exec ${SCRIPTS:-/}start-validateCurseInstance "$@" - ;; - MAGMA) exec ${SCRIPTS:-/}start-deployMagma "$@" ;; @@ -169,7 +165,7 @@ case "${TYPE^^}" in *) log "Invalid type: '$TYPE'" log "Must be: VANILLA, FORGE, BUKKIT, SPIGOT, PAPER, FTBA (multiarch-only)," - log " CURSE_INSTANCE, CURSEFORGE, SPONGEVANILLA, PURPUR, CUSTOM," + log " CURSEFORGE, SPONGEVANILLA, PURPUR, CUSTOM," log " MAGMA, MOHIST, CATSERVER, AIRPLANE, CANYON, LIMBO, CRUCIBLE" exit 1 ;; diff --git a/start-deployAirplane b/scripts/start-deployAirplane similarity index 100% rename from start-deployAirplane rename to scripts/start-deployAirplane diff --git a/start-deployBukkitSpigot b/scripts/start-deployBukkitSpigot similarity index 100% rename from start-deployBukkitSpigot rename to scripts/start-deployBukkitSpigot diff --git a/start-deployCF b/scripts/start-deployCF similarity index 100% rename from start-deployCF rename to scripts/start-deployCF diff --git a/start-deployCanyon b/scripts/start-deployCanyon similarity index 100% rename from start-deployCanyon rename to scripts/start-deployCanyon diff --git a/start-deployCatserver b/scripts/start-deployCatserver similarity index 100% rename from start-deployCatserver rename to scripts/start-deployCatserver diff --git a/start-deployCrucible b/scripts/start-deployCrucible old mode 100644 new mode 100755 similarity index 100% rename from start-deployCrucible rename to scripts/start-deployCrucible diff --git a/start-deployCustom b/scripts/start-deployCustom similarity index 100% rename from start-deployCustom rename to scripts/start-deployCustom diff --git a/start-deployFTBA b/scripts/start-deployFTBA similarity index 98% rename from start-deployFTBA rename to scripts/start-deployFTBA index f3eeaca4..5c6f5c49 100755 --- a/start-deployFTBA +++ b/scripts/start-deployFTBA @@ -16,7 +16,7 @@ if ! [[ ${FTB_MODPACK_ID} =~ [0-9]+ ]]; then exit 1 fi -if ! [[ -v FTB_MODPACK_VERSION_ID ]]; then +if [[ ! $FTB_MODPACK_VERSION_ID ]]; then if ! FTB_MODPACK_VERSION_ID=$(curl -fsSL https://api.modpacks.ch/public/modpack/${FTB_MODPACK_ID} | jq -r '.versions | sort_by(.updated)[-1].id'); then log "ERROR unable to resolve latest modpack version ID for modpack ${FTB_MODPACK_ID}" exit 1 diff --git a/start-deployFabric b/scripts/start-deployFabric similarity index 100% rename from start-deployFabric rename to scripts/start-deployFabric diff --git a/start-deployForge b/scripts/start-deployForge similarity index 98% rename from start-deployForge rename to scripts/start-deployForge index 088f4a6e..c531caaf 100755 --- a/start-deployForge +++ b/scripts/start-deployForge @@ -136,7 +136,7 @@ resolve_versions installMarker="/data/.forge-installed-$shortForgeVersion" -if [ ! -e "$installMarker" ]; then +if [ ! -e "$installMarker" ] || isTrue "${FORCE_REINSTALL:-false}"; then install else SERVER=$(cat "$installMarker") diff --git a/start-deployLimbo b/scripts/start-deployLimbo similarity index 100% rename from start-deployLimbo rename to scripts/start-deployLimbo diff --git a/start-deployMagma b/scripts/start-deployMagma similarity index 100% rename from start-deployMagma rename to scripts/start-deployMagma diff --git a/start-deployMohist b/scripts/start-deployMohist similarity index 100% rename from start-deployMohist rename to scripts/start-deployMohist diff --git a/start-deployPaper b/scripts/start-deployPaper similarity index 100% rename from start-deployPaper rename to scripts/start-deployPaper diff --git a/start-deployPurpur b/scripts/start-deployPurpur similarity index 100% rename from start-deployPurpur rename to scripts/start-deployPurpur diff --git a/start-deploySpongeVanilla b/scripts/start-deploySpongeVanilla similarity index 100% rename from start-deploySpongeVanilla rename to scripts/start-deploySpongeVanilla diff --git a/start-deployVanilla b/scripts/start-deployVanilla similarity index 100% rename from start-deployVanilla rename to scripts/start-deployVanilla diff --git a/start-finalExec b/scripts/start-finalExec similarity index 95% rename from start-finalExec rename to scripts/start-finalExec index 3bb80e77..60e78d40 100755 --- a/start-finalExec +++ b/scripts/start-finalExec @@ -180,14 +180,7 @@ if [[ ${STOP_SERVER_ANNOUNCE_DELAY} ]]; then mcServerRunnerArgs+=(--stop-server-announce-delay "${STOP_SERVER_ANNOUNCE_DELAY}s") fi -if [[ ${TYPE} == "CURSE_INSTANCE" ]]; then - if isTrue ${DEBUG_EXEC}; then - set -x - fi - exec mc-server-runner "${mcServerRunnerArgs[@]}" \ - --cf-instance-file "${CURSE_INSTANCE_JSON}" \ - java $JVM_XX_OPTS $JVM_OPTS $expandedDOpts -jar _SERVERJAR_ "$@" $EXTRA_ARGS -elif [[ ${TYPE} == "CURSEFORGE" && "${SERVER}" ]]; then +if [[ ${TYPE} == "CURSEFORGE" && "${SERVER}" ]]; then copyFilesForCurseForge cd "${FTB_DIR}" || (log "ERROR: can't go into ${FTB_DIR}"; exit 1) diff --git a/start-setupEnvVariables b/scripts/start-setupEnvVariables similarity index 100% rename from start-setupEnvVariables rename to scripts/start-setupEnvVariables diff --git a/start-setupModconfig b/scripts/start-setupModconfig similarity index 100% rename from start-setupModconfig rename to scripts/start-setupModconfig diff --git a/start-setupModpack b/scripts/start-setupModpack similarity index 100% rename from start-setupModpack rename to scripts/start-setupModpack diff --git a/start-setupMounts b/scripts/start-setupMounts similarity index 100% rename from start-setupMounts rename to scripts/start-setupMounts diff --git a/start-setupServerProperties b/scripts/start-setupServerProperties similarity index 100% rename from start-setupServerProperties rename to scripts/start-setupServerProperties diff --git a/start-setupWorld b/scripts/start-setupWorld similarity index 100% rename from start-setupWorld rename to scripts/start-setupWorld diff --git a/start-spiget b/scripts/start-spiget similarity index 100% rename from start-spiget rename to scripts/start-spiget diff --git a/start-utils b/scripts/start-utils similarity index 100% rename from start-utils rename to scripts/start-utils diff --git a/start-validateCurseInstance b/start-validateCurseInstance deleted file mode 100755 index 33024d57..00000000 --- a/start-validateCurseInstance +++ /dev/null @@ -1,17 +0,0 @@ -#!/bin/bash - -. ${SCRIPTS:-/}start-utils - -if ! [[ -v CURSE_INSTANCE_JSON ]]; then - log "ERROR: CURSE_INSTANCE_JSON needs to be set" - exit 2 -elif ! [ -f "${CURSE_INSTANCE_JSON}" ] && [ -f "${CURSE_INSTANCE_JSON}/minecraftinstance.json" ]; then - CURSE_INSTANCE_JSON="${CURSE_INSTANCE_JSON}/minecraftinstance.json" -elif ! [ -f "${CURSE_INSTANCE_JSON}" ]; then - log "ERROR: CURSE_INSTANCE_JSON file does not exist: ${CURSE_INSTANCE_JSON}" - exit 2 -fi - -log "Resolved CURSE_INSTANCE_JSON as ${CURSE_INSTANCE_JSON}" - -exec ${SCRIPTS:-/}start-setupWorld "$@"