Closed maximlomans closed 6 years ago
i found it you already have a raspberypi image if only i could get to it without pulling half of github this could av been such an easy clean task instead im ripping my hair out. how does one pull the minecraft-server dir only then rebuild it for an arm os. Dockerfile is already there . even docker-compose.yml
i take it i'd have to initiate git in a clean dir ,well it'll create one, fetch the dockerfiles.git master branch then do a --relative checkout of the minecraft-server dir ?
i hate wasting bandwidth anything not to mention there's an sd card in the pi3
@marxenegls yeah, it's most of the way there, but Docker Hub doesn't natively allow building non-x86 images. Let me see if this approach from resin.io will get it the rest of the way.
But yes, in the meantime you could git clone the repo, which has a lot of directories but is pretty small in overall size, and build in the minecraft-server directory:
git clone https://github.com/itzg/dockerfiles.git
git checkout mc/raspberrypi
cd minecraft-server
docker build -t mc .
This is related to #114
The image built successfully as the tag raspberrypi
. I am currently testing using:
docker pull itzg/minecraft-server:raspberrypi
thanks appreciate your quick reply ... i promised my kid i'd set it up she loves minecraft but is very very particular as to what can and can not be in her world , no zombies, no hunts, no battles, no sudden movements ..etc plus she'd like to be able to invite her girlfriends , so i figured her own server would be safest bet.
You'll definitely want to increase the -e MEMORY=...
setting from the "50M" in the default. I based that off of my Model B Rev 1.0, but am finding I can increase a bit more now that I have a fully working image.
docker run -d -it -v pwd
:/data -e EULA=TRUE -e MEMORY="300M" -p 25565:25565 --name mc1 itzg/minecraft-server:raspberrypi
i got running but i'm having difficulties reaching it .. on -p 25565 ,
-H tcp://0.0.0.0:2375 error unknown -H (using docker-ce-18.0.3)
ran a netstat and saw :::25565. i tried setting host ip manually in server.properties but it refused to start, i the set the ip to 0.0.0.0 instead and it's holding up, pushed forge-1.12.2-14.23.4.2705-universal.jar to /mods dir but i noticed
/data/mods /data/plugins are duplicated another set of dirs in '/ 'directory
or
/mods /plugins in container's ' / 'dir so is the './start entrypoint' but im coming in /data
the minecraft_server.1.12.2.jar is in /data mapped to volume
The inner host IP will be fine with the default, but perhaps double check there isn’t an iptables
rule blocking external access to that port.
i think i got something in the logs it seems jvm is set to 1024
i saw it busy spawning and then it crashed, not the container the jvm.. out of mem at bottom
it's also pulling down another minecraft.jar i have one in data volume - i guess it always does that
logs:
Checking version information.
Checking type information.
Downloading minecraft_server.1.12.2.jar ...
Creating server.properties in /data/server.properties
Setting server-port to '25565' in /data/server.properties
Setting motd to 'A Vanilla Minecraft Server powered by Docker' in /data/server.properties
Skip setting allow-nether
Skip setting announce-player-achievements
Skip setting enable-command-block
Skip setting spawn-animals
Skip setting spawn-monsters
Skip setting spawn-npcs
Skip setting generate-structures
Skip setting view-distance
Skip setting hardcore
Skip setting snooper-enabled
Skip setting max-build-height
Skip setting force-gamemode
Skip setting hardmax-tick-timecore
Skip setting enable-query
Skip setting query.port
Setting enable-rcon to 'true' in /data/server.properties
Setting rcon.password to 'minecraft' in /data/server.properties
Setting rcon.port to '25575' in /data/server.properties
Skip setting max-players
Skip setting max-world-size
Setting level-name to 'world' in /data/server.properties
Skip setting level-seed
Setting pvp to 'true' in /data/server.properties
Skip setting generator-settings
Setting online-mode to 'true' in /data/server.properties
Skip setting allow-flight
Setting level type to DEFAULT
Setting level-type to 'DEFAULT' in /data/server.properties
Setting difficulty to '1' in /data/server.properties
Skipping JSON check. No files present.
Setting initial memory to 300M and max to 300M
Java HotSpot(TM) Client VM warning: G1 GC is disabled in this release.
[19:57:33] [Server thread/INFO]: Starting minecraft server version 1.12.2
[19:57:33] [Server thread/WARN]: To start the server with more ram, launch it as "java -Xmx1024M -Xms1024M -jar minecraft_server.jar"
[19:57:33] [Server thread/INFO]: Loading properties
[19:57:33] [Server thread/INFO]: Default game type: SURVIVAL
[19:57:33] [Server thread/INFO]: Generating keypair
[19:57:36] [Server thread/INFO]: Starting Minecraft server on *:25565
Java HotSpot(TM) Client VM warning: You have loaded library /tmp/libnetty-transport-native-epoll29336838761112090.so which might have disabled stack guard. The VM will try to fix the stack guard now.
It's highly recommended that you fix the library with 'execstack -c
[20:01:44] [Server thread/INFO]: Starting remote control listener [20:01:44] [RCON Listener #1/INFO]: RCON running on 0.0.0.0:25575 [20:02:01] [Server thread/WARN]: Can't keep up! Did the system time change, or is the server overloaded? Running 16038ms behind, skipping 320 tick(s) [20:02:07] [Server thread/WARN]: Can't keep up! Did the system time change, or is the server overloaded? Running 6547ms behind, skipping 130 tick(s) [20:03:03] [Server thread/WARN]: Can't keep up! Did the system time change, or is the server overloaded? Running 14461ms behind, skipping 289 tick(s) Checking version information.
Checking type information. server.properties already created, skipping Skipping JSON check. No files present.
Setting initial memory to 300M and max to 300M Java HotSpot(TM) Client VM warning: G1 GC is disabled in this release. [21:46:25] [Server thread/INFO]: Starting minecraft server version 1.12.2 [21:46:25] [Server thread/WARN]: To start the server with more ram, launch it as "java -Xmx1024M -Xms1024M -jar minecraft_server.jar"
i also just oticed the time/date is off by at least 9hrs
see it, RCON returns actual time and server freaks out cant keep up what's happening .. tried using sudo to cp zoneinfo and even set passwd of coarse to use sudo edit etc etc read a suggestion of using -v /etc/localtime . i'll stop the server add more ram and set time and let you know what gives
same thing
[03:21:40] [Server thread/INFO]: Preparing spawn area: 83% [03:21:41] [Server thread/INFO]: Preparing spawn area: 88% [03:21:42] [Server thread/INFO]: Preparing spawn area: 94%
[03:21:43] [Server thread/INFO]: Starting remote control listener [03:21:43] [RCON Listener #1/INFO]: RCON running on 0.0.0.0:25575 [03:22:30] [Server thread/WARN]: Can't keep up! Did the system time change, or is the server overloaded? Running 2419ms behind, skipping 48 tick(s)
the date/time now though matches that of the host, i checked
docker run -d -p 25565:25565 -v /etc/localtime:/etc/localtime:ro -v pwd
:/data -e EULA=TRUE -e MEMORY="600M" --name mc1 itzg/minecraft-server:raspberrypi
is it the fact that image is compiled for cpu armv6 - i'm on a pi3 armv7 related ? clock speed ?? :(
i stumbled on blog with a similar project ... (https://www.jamesachambers.com/2018/03/fast-raspberry-pi-minecraft-server-install-script/) i read up on jvm -XX opt and it seems GC opt is for multi threaded big ram capacity machines . JVM_XX_OPTS ="XX: -Xss320K -Xms 600M -Xmx800M" seems more adequate for arm devices there's an available openjdk-9-jdk-headless and tweaked the hertz of sdCard read/write speed + armv7 i've edited the dockerfile but it not enough i'd hate to start pulling another image or a piece of one , at this point i]m doubting whether to install it or run inside a docker - i got two days left before school is out .
Honestly, I'm not impressed at all with the performance of the Minecraft server on RaspberryPi. The RaspberryPi is just too underpowered for the official server, which assumes large amounts of RAM (as you saw from its suggestion about using 1024m) and large amounts of floating-point compute capacity.
As evidence, the RaspberryPI foundation bundles a build of Minecraft, but I assume they have highly optimized (i.e. stripped down) that implementation.
Regarding your previous comments:
launch it as "java -Xmx1024M -Xms1024M -jar minecraft_server.jar"
is their server itself suggesting that 1024m be the minimum memory allocated
how should i go about building a dockerfile for a raspbian based image i have a cluster of four but not sure if swarm mode gets the memory shared as a whole group or individual nodes each node has 970Mb of ram . i doubt just editing the ENV param to arm32v7 will do, i'm guessing the restify , rcon-cli and mc-server need to be recompiled ?
thanks