binhex / arch-minecraftserver Goto Github PK
View Code? Open in Web Editor NEWDocker build script for Arch Linux base with Minecraft Java server
License: GNU General Public License v3.0
Docker build script for Arch Linux base with Minecraft Java server
License: GNU General Public License v3.0
hi,
i would love to see an toggle like true/false for turning off Downloading latest Vanilla version.
i use mostly Papermc and waterfall for bungeecord and i dont need the vanilla jar.
Like this its waste of space. When i run like 10 servers (game servers) and every server has like 40mb - 50mb wasted space it would use 400mb - 500mb of my harddrive for nothing
root@ubuntu:/home/xinmans# docker run -d \
-p 8222:8222/tcp \ -p 25565:25565 \ --name=minecraftserver \ -v /apps/docker/minecraftserver:/config \ -v /etc/localtime:/etc/localtime:ro \ -e CREATE_BACKUP_HOURS=12 \ -e PURGE_BACKUP_DAYS=14 \ -e ENABLE_WEBUI_CONSOLE=yes \ -e ENABLE_WEBUI_AUTH=yes \ -e WEBUI_USER=admin \ -e WEBUI_PASS=minecraft \ -e WEBUI_CONSOLE_TITLE='Minecraft Server' \ -e CUSTOM_JAR_PATH=/config/minecraft/paperclip.jar \ -e JAVA_VERSION=latest \ -e JAVA_INITIAL_HEAP_SIZE=512M \ -e JAVA_MAX_HEAP_SIZE=1024M \ -e JAVA_MAX_THREADS=1 \ -e STARTUP_CMD=gamerule reducedDebugInfo true \ -e UMASK=000 \ -e PUID=0 \ -e PGID=0 \ binhex/arch-minecraftserver
docker: invalid reference format: repository name must be lowercase.
See 'docker run --help'.
root@ubuntu:/home/xinmans# exit
If the minecraft server process crashes, a manual restart of the container is required to get it back in working order. I would expect that either the minecraft server process is restarted automatically inside the container, or that the entire container goes down (so that it can be restarted by an orchestrator).
I was doing some testing with a server status bot and it would post a message on when the server has stopped. Stopping the docker container does not cause the server to properly stop and abruptly shuts it down. This could lead to corrupted saves and loss of world data.
I have used forge without issues previous to 1.18.2. Since this version forge has changed the way they package their software so that it is no longer a single .jar
I have got it working by manually editing the docker and replacing the following line 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"
With:
screen -L -Logfile '/config/minecraft/logs/screen.log' -d -S minecraft -m bash -c "cd /config/minecraft && /usr/lib/jvm/java-17-openjdk/bin/java @user_jvm_args.txt @libraries/net/minecraftforge/forge/1.18.2-40.2.1/unix_args.txt "$@""
Note that originally it was using java 19 by default and that was causing it to crash, i had manually installed 17 and that is now working with the above.
@user_jvm_args.txt @libraries/net/minecraftforge/forge/1.18.2-40.2.1/unix_args.txt "$@"
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.
I'm currently trying to get a Minecraft server copied over from my Windows desktop to my Unraid NAS that's running a FeedTheBeast modpack. However, the current Docker config does not allow me to set the necessary startup args that are necessary (or at least recommended).
Specifically, the command line I'm currently using is:
java.exe -server -XX:+UseG1GC -XX:+UnlockExperimentalVMOptions -Xmx6144M -Xms4096M -jar forge-1.12.2-14.23.5.2846-universal.jar nogui
-server
, -Xmx
, -Xms
, -jar
, and nogui
are all already either configurable or not necessary. However, UseG1GC
and UnlockExperimentalVMOptions
are not. Additionally, I believe UseG1GC
conflicts with the -XX:ParallelGCThreads
that is currently getting passed in.
Would it be possible to add the option to set these properly? Or alternatively, adding the option for a CUSTOM_STARTUP_COMMAND
variable or similar that, if set, overrides the current startup command?
The newest pre-release requires a newer version of java. The first PR from 1.18 worked via setting the CUSTOM_JAR_PATH.
JAVA_VERSION does not seem to respect 17 as a setting.
https://minecraft.fandom.com/wiki/Java_Edition_1.18_Pre-release_2
Since there's no way to set the server version via an environmental variable I tried copying the jar I wanted and renamed it to minecraft_server.jar
. It gets overwritten with the 1.16.5 version though.
I'm running a local papermc server and this warning started to show up lately:
- WARNING - YOU ARE RUNNING AN OUTDATED VERSION OF JAVA.
- PAPER WILL STOP BEING COMPATIBLE WITH THIS VERSION OF
- JAVA WHEN MINECRAFT 1.17 IS RELEASED.
- Please update the version of Java you use to run Paper
- to at least Java 16. When Paper for Minecraft 1.17 is
- released support for versions of Java before 16 will
- be dropped.
- Current Java version: 11.0.10
- Check this forum post for more information:
- https://papermc.io/java16
If you would add Java version 16 to list of options, it would be great.
Which would also require changing the available environment variables from
-e JAVA_VERSION=<8|11>
to
-e JAVA_VERSION=<8|11|16>
amongst other things of course.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.