binhex / arch-minecraftserver

Docker build script for Arch Linux base with Minecraft Java server
GNU General Public License v3.0
17 stars 27 forks source link

Not allowing additional java flags #16

Open mddewittjr opened 11 months ago

mddewittjr commented 11 months ago

I love your containerized Minecraft server by the way you mostly set up things. However, is it possible to add a key for extra Java flags by restructuring the start? sh flags in the start function.

Currently, you have this code on line 124 in start.sh: 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"

Again, add another key to the container called {JAVA_EXTRA_PARAMS} and a function to take all the added parameters separated by a comma and replace them with spaces or something. Example: JAVA EXTRA PARAMS ---> -XX:+UseG1GC, -XX:+AlwaysPreTouch, etc

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_EXTRA_PARAMS} ${java_log4j_mitigation} -jar ${CUSTOM_JAR_PATH} nogui"

the reason is that there are more flags that can be added, such as ShenandoahGC or whatever else to fine-tune the server.

Currently, I am using your container as a home for folia because of your backup feature and I am not that smart at building containers.

Let me know what you think.