Running a GreedyCraft server with itzg/docker-minecraft-server

A quick guide on spinning up a GreedyCraft server in docker with the itzg/docker-minecraft-server container and docker-compose on Linux.

  1. Download the GreedyCraft server files zip file.
  2. Extract the files to a temporary folder. We need to make some changes.
    • Rename run-linux.sh to run.sh This is the shell file the docker container will expect, if you do not rename the file, the server will fail to start.
    • Edit run.sh to include the JVM custom flags. See the README_SERVER_INSALLATION.txt for more information about this. For example, assuming a 20GB allocation you could use:
java -Xmx20G -Xms20G -Xss4M -Dfile.encoding=GBK -Dsun.rmi.dgc.server.gcInterval=1800000 -XX:+UseG1GC -XX:+UnlockExperimentalVMOptions -XX:G1NewSizePercent=20 -XX:G1ReservePercent=20 -XX:MaxGCPauseMillis=50 -XX:+AlwaysPreTouch -XX:+UseStringDeduplication -Dfml.ignorePatchDiscrepancies=true -Dfml.ignoreInvalidMinecraftCertificates=true -XX:-OmitStackTraceInFastThrow -XX:+OptimizeStringConcat -XX:+UseAdaptiveGCBoundary -XX:G1HeapRegionSize=32M -jar forge-1.12.2-14.23.5.2855.jar nogui
  • Edit the server.properties files per the README_SERVER_INSALLATION.txt file. As of this writing, ensure your server.properties has the following lines somewhere in it:
difficulty=3
level-type=BIOMESOP
enable-command-block=true
allow-flight=true
  1. Re-zip your files. Name the zip file something like greedy.zip. The file structure in this zip should mirror the one you downloaded.
  2. Copy this zip file wherever you intend your server files to be. For example /var/docker/greedycraft
  3. Edit your docker-compose.yml file and add your configurations. For example, if using 20GB of memory and a data directory of /var/docker/greedycraft and a customized server zip file at /var/docker/greedycraft/greedy.zip a docker-compose.yml file would look something like (Customize memory and such as needed!):
version: "3"
services:
  greedycraft:
    image: itzg/minecraft-server:java8
    container_name: greedycraft
    ports:
      - "25565:25565"
    restart: unless-stopped
    environment:
      EULA: "TRUE"
      SNOOPER_ENABLED: "FALSE"
      MAX_MEMORY: "20G"
      ENABLE_ROLLING_LOGS: "TRUE"
      ENABLE_AUTOPAUSE: "FALSE"
      OVERRIDE_SERVER_PROPERTIES: "TRUE"
      MAX_TICK_TIME: "-1"
      MAX_PLAYERS: "32"
      TYPE: "CURSEFORGE"
      CF_SERVER_MOD: "greedy.zip"
      VERSION: "1.12.2"
    volumes:
      - "/var/docker/greedycraft:/data"
    networks:
      - external

networks:
  external:
  1. If all is well, you should be able to start your server by reloading your compose file by running docker-compose up -d from the same directory as your docker-compose.yml file.
  2. Monitor your server with docker logs greedycraft assuming you named the container greedycraft like in the example above. If you see repeating logs and docker container ls -a shows your container either restarting or with a short uptime, you may have an issue. Stop the container and review the logs to troubleshoot. If you see Stopping aura thread for dim xxx however, then you should be good to go! (Assuming no firewall issues and port-forwarding was setup correctly if running across networks, but those are outside the scope of this quick-guide.)

MIM Portal Patch Fails

Just a quick post. I ran into an issue updating the MIM Portal. Looking at logs, I found a line reading that a step had failed. The step that failed was just a quick command line run of net start fimservice. Odd step to fail on right?

After running the updater a few times I figured out the issue. The service just was not starting within the 5 second or so time limit of the net start command. Net start returned a non-zero return code and the fim portal service updater treated that as a failure.

The fix is pretty easy though. That net start command spawns in a new cmd prompt window. When you see it, just highlight a character inside the cmd prompt window and that will freeze the command. Check to ensure the fimservice service is started, then press the “enter” key while in cmd prompt to allow it to continue. Net start will see the service is running and return zero to the updater and the updater will happily finish up. Just keep in mind, you have to watch out for that cmd prompt, you only have about a 5 second window to catch and pause it!