Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,8 @@ If you do **NOT** want world backups and/or purging of backups then set the valu

Env var 'CUSTOM_JAR_PATH' is optional and allows you to define a specific jar to run, if not specified then the latest Mojang Minecraft jar will be used.

Env var 'CUSTOM_STARTUP_SCRIPT' is optional and allows you to run a specific sh script instead of a jar file

Env vars 'JAVA_INITIAL_HEAP_SIZE' value and 'JAVA_MAX_HEAP_SIZE' values must be a multiple of 1024 and greater than 2MB.

User ID (PUID) and Group ID (PGID) can be found by issuing the following command for the user you want to run the container as:-
Expand All @@ -90,4 +92,4 @@ If you appreciate my work, then please consider buying me a beer :D

[![PayPal donation](https://www.paypal.com/en_US/i/btn/btn_donate_SM.gif)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=MM5E27UX6AUU4)

[Documentation](https://github.com/binhex/documentation) | [Support forum](https://forums.unraid.net/topic/84880-support-binhex-minecraftserver/)
[Documentation](https://github.com/binhex/documentation) | [Support forum](https://forums.unraid.net/topic/84880-support-binhex-minecraftserver/)
2 changes: 1 addition & 1 deletion build/root/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ fi
####

# define pacman packages
pacman_packages="jre8-openjdk-headless jre11-openjdk-headless jre-openjdk-headless screen rsync"
pacman_packages="jre8-openjdk-headless jre11-openjdk-headless jre-openjdk-headless screen rsync which"

# install compiled packages using pacman
if [[ ! -z "${pacman_packages}" ]]; then
Expand Down
10 changes: 9 additions & 1 deletion run/nobody/start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -118,10 +118,18 @@ function start_minecraft() {
# create logs sub folder to store screen output from console
mkdir -p /config/minecraft/logs

# allow custom scripts instead of forced jar - useful to run modern modpacks
if [[ -z "${CUSTOM_STARTUP_SCRIPT}" ]]; then
run_script="java -Xms${JAVA_INITIAL_HEAP_SIZE} -Xmx${JAVA_MAX_HEAP_SIZE} -XX:ParallelGCThreads=${JAVA_MAX_THREADS} ${java_log4j_mitigation} -jar ${CUSTOM_JAR_PATH} nogui"
else
chmod +x "${CUSTOM_STARTUP_SCRIPT}"
run_script="${CUSTOM_STARTUP_SCRIPT}"
fi

# run screen attached to minecraft (daemonized, non-blocking) to allow users to run commands in minecraft console
echo "[info] Starting Minecraft Java process..."
set -x
screen -L -Logfile '/config/minecraft/logs/screen.log' -d -S minecraft -m bash -c "cd /config/minecraft && java -Xms${JAVA_INITIAL_HEAP_SIZE} -Xmx${JAVA_MAX_HEAP_SIZE} -XX:ParallelGCThreads=${JAVA_MAX_THREADS} ${java_log4j_mitigation} -jar ${CUSTOM_JAR_PATH} nogui"
screen -L -Logfile '/config/minecraft/logs/screen.log' -d -S minecraft -m bash -c "cd /config/minecraft && ${run_script}"
set +x
echo "[info] Minecraft Java process is running"
if [[ ! -z "${STARTUP_CMD}" ]]; then
Expand Down