mirror of
https://github.com/itzg/docker-minecraft-server.git
synced 2026-08-21 22:43:19 +00:00
Added support for TYPE=CURSE_INSTANCE
This commit is contained in:
+2
-1
@@ -1,4 +1,5 @@
|
|||||||
data
|
data
|
||||||
examples
|
examples
|
||||||
k8s-examples
|
k8s-examples
|
||||||
.idea
|
.idea
|
||||||
|
.git
|
||||||
+1
-1
@@ -49,7 +49,7 @@ RUN easy-add --var os=${TARGETOS} --var arch=${TARGETARCH}${TARGETVARIANT} \
|
|||||||
--from https://github.com/itzg/{{.app}}/releases/download/{{.version}}/{{.app}}_{{.version}}_{{.os}}_{{.arch}}.tar.gz
|
--from https://github.com/itzg/{{.app}}/releases/download/{{.version}}/{{.app}}_{{.version}}_{{.os}}_{{.arch}}.tar.gz
|
||||||
|
|
||||||
RUN easy-add --var os=${TARGETOS} --var arch=${TARGETARCH}${TARGETVARIANT} \
|
RUN easy-add --var os=${TARGETOS} --var arch=${TARGETARCH}${TARGETVARIANT} \
|
||||||
--var version=1.3.5 --var app=mc-server-runner --file {{.app}} \
|
--var version=1.4.2 --var app=mc-server-runner --file {{.app}} \
|
||||||
--from https://github.com/itzg/{{.app}}/releases/download/{{.version}}/{{.app}}_{{.version}}_{{.os}}_{{.arch}}.tar.gz
|
--from https://github.com/itzg/{{.app}}/releases/download/{{.version}}/{{.app}}_{{.version}}_{{.os}}_{{.arch}}.tar.gz
|
||||||
|
|
||||||
RUN easy-add --var os=${TARGETOS} --var arch=${TARGETARCH}${TARGETVARIANT} \
|
RUN easy-add --var os=${TARGETOS} --var arch=${TARGETARCH}${TARGETVARIANT} \
|
||||||
|
|||||||
@@ -0,0 +1,20 @@
|
|||||||
|
version: "3.7"
|
||||||
|
|
||||||
|
services:
|
||||||
|
mc:
|
||||||
|
image: itzg/minecraft-server
|
||||||
|
ports:
|
||||||
|
- 25565:25565
|
||||||
|
volumes:
|
||||||
|
# Attach .../Curse/Minecraft/Instances for use at /instances
|
||||||
|
- ./Instances:/instances:ro
|
||||||
|
# Attach /data as usual
|
||||||
|
- ./ServerData:/data
|
||||||
|
environment:
|
||||||
|
EULA: "TRUE"
|
||||||
|
# Modpacks generally need more memory, so let's give at 2 GB
|
||||||
|
MEMORY: 2G
|
||||||
|
# Use new CURSE_INSTANCE type
|
||||||
|
TYPE: CURSE_INSTANCE
|
||||||
|
# Reference directory of or full path to minecraftinstance.json
|
||||||
|
CURSE_INSTANCE_JSON: /instances/FTB Presents SkyFactory 3
|
||||||
+20
-15
@@ -20,8 +20,8 @@ if [ ! -e /data/eula.txt ]; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
echo "# Generated via Docker on $(date)" > eula.txt
|
echo "# Generated via Docker on $(date)" > eula.txt
|
||||||
echo "eula=$EULA" >> eula.txt
|
|
||||||
if [ $? != 0 ]; then
|
if ! echo "eula=$EULA" >> eula.txt; then
|
||||||
log "ERROR: unable to write eula to /data. Please make sure attached directory is writable by uid=${UID}"
|
log "ERROR: unable to write eula to /data. Please make sure attached directory is writable by uid=${UID}"
|
||||||
exit 2
|
exit 2
|
||||||
fi
|
fi
|
||||||
@@ -49,56 +49,61 @@ export VERSIONS_JSON=https://launchermeta.mojang.com/mc/game/version_manifest.js
|
|||||||
|
|
||||||
case "X$VERSION" in
|
case "X$VERSION" in
|
||||||
X|XLATEST|Xlatest)
|
X|XLATEST|Xlatest)
|
||||||
export VANILLA_VERSION=`curl -fsSL $VERSIONS_JSON | jq -r '.latest.release'`
|
VANILLA_VERSION=$(curl -fsSL $VERSIONS_JSON | jq -r '.latest.release')
|
||||||
;;
|
;;
|
||||||
XSNAPSHOT|Xsnapshot)
|
XSNAPSHOT|Xsnapshot)
|
||||||
export VANILLA_VERSION=`curl -fsSL $VERSIONS_JSON | jq -r '.latest.snapshot'`
|
VANILLA_VERSION=$(curl -fsSL $VERSIONS_JSON | jq -r '.latest.snapshot')
|
||||||
;;
|
;;
|
||||||
X[1-9]*)
|
X[1-9]*)
|
||||||
export VANILLA_VERSION=$VERSION
|
VANILLA_VERSION=$VERSION
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
export VANILLA_VERSION=`curl -fsSL $VERSIONS_JSON | jq -r '.latest.release'`
|
VANILLA_VERSION=$(curl -fsSL $VERSIONS_JSON | jq -r '.latest.release')
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
export VANILLA_VERSION
|
||||||
log "Resolved version given ${VERSION} into ${VANILLA_VERSION}"
|
log "Resolved version given ${VERSION} into ${VANILLA_VERSION}"
|
||||||
|
|
||||||
cd /data
|
cd /data || exit 1
|
||||||
|
|
||||||
export ORIGINAL_TYPE=${TYPE^^}
|
export ORIGINAL_TYPE=${TYPE^^}
|
||||||
|
|
||||||
log "Resolving type given ${TYPE}"
|
log "Resolving type given ${TYPE}"
|
||||||
case "${TYPE^^}" in
|
case "${TYPE^^}" in
|
||||||
*BUKKIT|SPIGOT)
|
*BUKKIT|SPIGOT)
|
||||||
exec /start-deployBukkitSpigot $@
|
exec /start-deployBukkitSpigot "$@"
|
||||||
;;
|
;;
|
||||||
|
|
||||||
PAPER)
|
PAPER)
|
||||||
exec /start-deployPaper $@
|
exec /start-deployPaper "$@"
|
||||||
;;
|
;;
|
||||||
|
|
||||||
FORGE)
|
FORGE)
|
||||||
exec /start-deployForge $@
|
exec /start-deployForge "$@"
|
||||||
;;
|
;;
|
||||||
|
|
||||||
FABRIC)
|
FABRIC)
|
||||||
exec /start-deployFabric $@
|
exec /start-deployFabric "$@"
|
||||||
;;
|
;;
|
||||||
|
|
||||||
FTB|CURSEFORGE)
|
FTB|CURSEFORGE)
|
||||||
exec /start-deployFTB $@
|
exec /start-deployFTB "$@"
|
||||||
;;
|
;;
|
||||||
|
|
||||||
VANILLA)
|
VANILLA)
|
||||||
exec /start-deployVanilla $@
|
exec /start-deployVanilla "$@"
|
||||||
;;
|
;;
|
||||||
|
|
||||||
SPONGEVANILLA)
|
SPONGEVANILLA)
|
||||||
exec /start-deploySpongeVanilla $@
|
exec /start-deploySpongeVanilla "$@"
|
||||||
;;
|
;;
|
||||||
|
|
||||||
CUSTOM)
|
CUSTOM)
|
||||||
exec /start-deployCustom $@
|
exec /start-deployCustom "$@"
|
||||||
|
;;
|
||||||
|
|
||||||
|
CURSE_INSTANCE)
|
||||||
|
exec /start-validateCurseInstance "$@"
|
||||||
;;
|
;;
|
||||||
|
|
||||||
*)
|
*)
|
||||||
|
|||||||
@@ -164,8 +164,15 @@ if isTrue "${USE_LARGE_PAGES}"; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
mcServerRunnerArgs="--stop-duration 60s"
|
mcServerRunnerArgs="--stop-duration 60s"
|
||||||
|
if [[ ${TYPE} == "CURSE_INSTANCE" ]]; then
|
||||||
if [[ ${TYPE} == "FEED-THE-BEAST" ]]; then
|
JVM_OPTS="-Xms${INIT_MEMORY} -Xmx${MAX_MEMORY} ${JVM_OPTS}"
|
||||||
|
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} == "FEED-THE-BEAST" ]]; then
|
||||||
mcServerRunnerArgs="${mcServerRunnerArgs} --shell bash"
|
mcServerRunnerArgs="${mcServerRunnerArgs} --shell bash"
|
||||||
|
|
||||||
if [ ! -e "${FTB_DIR}/ops.json" -a -e /data/ops.txt ]; then
|
if [ ! -e "${FTB_DIR}/ops.json" -a -e /data/ops.txt ]; then
|
||||||
|
|||||||
Executable
+18
@@ -0,0 +1,18 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
. /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}"
|
||||||
|
|
||||||
|
# Continue to Final Setup
|
||||||
|
exec /start-finalSetup01World "$@"
|
||||||
Reference in New Issue
Block a user