mirror of
https://github.com/itzg/docker-minecraft-server.git
synced 2026-07-31 12:45:57 +00:00
SERVER_RUNNER is expanded when exec'ed (#4183)
This commit is contained in:
@@ -206,6 +206,9 @@ If you are using a host-attached data directory, then you can have the image set
|
|||||||
|
|
||||||
By default, the image finishes startup by exec'ing [mc-server-runner](https://github.com/itzg/mc-server-runner) to run the Minecraft server itself. This can be replaced by setting the environment variable `SERVER_RUNNER`. The arguments passed will start with ones specific to mc-server-runner, followed by `--`, and then the actual `java -jar` arguments or equivalent server entry script, such as `run.sh` for Forge.
|
By default, the image finishes startup by exec'ing [mc-server-runner](https://github.com/itzg/mc-server-runner) to run the Minecraft server itself. This can be replaced by setting the environment variable `SERVER_RUNNER`. The arguments passed will start with ones specific to mc-server-runner, followed by `--`, and then the actual `java -jar` arguments or equivalent server entry script, such as `run.sh` for Forge.
|
||||||
|
|
||||||
|
> [!TIP]
|
||||||
|
> The `SERVER_RUNNER` variable is expanded when passed to `exec` so that `mc-server-runner` can be wrapped by another executable that is mounted into the container.
|
||||||
|
|
||||||
## Enable Flare Flags
|
## Enable Flare Flags
|
||||||
|
|
||||||
To enable the JVM flags required to fully support the [Flare profiling suite](https://blog.airplane.gg/flare), set the following variable:
|
To enable the JVM flags required to fully support the [Flare profiling suite](https://blog.airplane.gg/flare), set the following variable:
|
||||||
|
|||||||
@@ -497,7 +497,7 @@ if [[ ${TYPE} == "CURSEFORGE" && "${SERVER}" ]]; then
|
|||||||
if isTrue "${DEBUG_EXEC}"; then
|
if isTrue "${DEBUG_EXEC}"; then
|
||||||
set -x
|
set -x
|
||||||
fi
|
fi
|
||||||
exec "${SERVER_RUNNER}" ${bootstrapArgs} "${mcServerRunnerArgs[@]}" -- java $JVM_XX_OPTS $JVM_OPTS $expandedDOpts -jar "$(basename "${SERVER}")" "$@" $EXTRA_ARGS
|
exec ${SERVER_RUNNER} ${bootstrapArgs} "${mcServerRunnerArgs[@]}" -- java $JVM_XX_OPTS $JVM_OPTS $expandedDOpts -jar "$(basename "${SERVER}")" "$@" $EXTRA_ARGS
|
||||||
elif [[ ${TYPE} == "CURSEFORGE" ]]; then
|
elif [[ ${TYPE} == "CURSEFORGE" ]]; then
|
||||||
mcServerRunnerArgs+=(--shell bash)
|
mcServerRunnerArgs+=(--shell bash)
|
||||||
|
|
||||||
@@ -551,7 +551,7 @@ fi
|
|||||||
JVM_ARGS=${JVM_ARGS//$'\n'/}
|
JVM_ARGS=${JVM_ARGS//$'\n'/}
|
||||||
sed -i "s~JAVA_ARGS=.*~JAVA_ARGS=\"${JVM_ARGS}\"~" "${FTB_DIR}/variables.txt"
|
sed -i "s~JAVA_ARGS=.*~JAVA_ARGS=\"${JVM_ARGS}\"~" "${FTB_DIR}/variables.txt"
|
||||||
fi
|
fi
|
||||||
exec "${SERVER_RUNNER}" "${mcServerRunnerArgs[@]}" -- "${finalArgs[@]}"
|
exec ${SERVER_RUNNER} "${mcServerRunnerArgs[@]}" -- "${finalArgs[@]}"
|
||||||
elif [[ $SERVER =~ run.sh ]]; then
|
elif [[ $SERVER =~ run.sh ]]; then
|
||||||
log "Using Forge supplied run.sh script..."
|
log "Using Forge supplied run.sh script..."
|
||||||
echo $JVM_XX_OPTS $JVM_OPTS $expandedDOpts > user_jvm_args.txt
|
echo $JVM_XX_OPTS $JVM_OPTS $expandedDOpts > user_jvm_args.txt
|
||||||
@@ -562,7 +562,7 @@ elif [[ $SERVER =~ run.sh ]]; then
|
|||||||
if isTrue "${DEBUG_EXEC}"; then
|
if isTrue "${DEBUG_EXEC}"; then
|
||||||
set -x
|
set -x
|
||||||
fi
|
fi
|
||||||
exec "${SERVER_RUNNER}" "${mcServerRunnerArgs[@]}" --shell bash -- "${SERVER}" $EXTRA_ARGS
|
exec ${SERVER_RUNNER} "${mcServerRunnerArgs[@]}" --shell bash -- "${SERVER}" $EXTRA_ARGS
|
||||||
else
|
else
|
||||||
# If we have a bootstrap.txt file... feed that in to the server stdin
|
# If we have a bootstrap.txt file... feed that in to the server stdin
|
||||||
if [ -f $bootstrapPath ]; then
|
if [ -f $bootstrapPath ]; then
|
||||||
@@ -600,5 +600,5 @@ else
|
|||||||
set -x
|
set -x
|
||||||
fi
|
fi
|
||||||
|
|
||||||
exec "${SERVER_RUNNER}" ${bootstrapArgs} "${mcServerRunnerArgs[@]}" -- java "${finalArgs[@]}"
|
exec ${SERVER_RUNNER} ${bootstrapArgs} "${mcServerRunnerArgs[@]}" -- java "${finalArgs[@]}"
|
||||||
fi
|
fi
|
||||||
|
|||||||
Reference in New Issue
Block a user