Sign inSign up

jusito/docker-ftb-alpine

By jusito

Updated over 1 year ago

Simple images for: https://www.feed-the-beast.com

Image
1

100K+

jusito/docker-ftb-alpine repository overview

Minecraft modpacks meet alpine

This repository contains servers for minecraft modpacks like FTB: Build Status

By using this container you agree to the Minecraft Eula

Getting Started

  1. Which server you want? Which version you want? Choose you Tag below like DungeonsDragonsAndSpaceShuttles-7.4a-1.12.2
  2. Which Port? -p 25566:25565 means 25566 from internet, 25565 from inside of container
  3. Do you want default jvm arguments / RAM usage and so on? Yes go next, no see Environment Variables
  4. Should I enter an operator level 4? He would be also whitelisted. No go next, yes use -e ADMIN_NAME="YourNameHere"
  5. Do you want your own server.properties? No go next, yes see Environmental Variables, server.properties or see Additional Informations
Example Dungeons Dragons And Space Shuttles:
docker run -d -p 25565:25565 -v minecraft:/home/docker:rw -e ADMIN_NAME="YourNameHere" -e motd="Hello Docker" jusito/docker-ftb-alpine:DungeonsDragonsAndSpaceShuttles-7.4a-1.12.2

Tags

There are two different base images which provides different java virtual machine. The alpine images are amd64/x86 with Hotspot jvm as default (like expected) and openj9 is an option, multiarch isn't supported. I test every modpack with openj9 but if it doesn't even start the server, I will not push a tag with it. (forge with 1.15+ will throw unsupported virtual machine for openj9) Every tag is tested before push but this tags are more example configurations of the base images. Every provided tag will use the recommended server properties and forge version from modpack creator - if not its a bug and please report it. If you want to use the nightly images append "-develop" to the tag.

most recent
other
no Tag found?
  • Tag: 8jre-alpine-hotspot or 8jre-alpine-openj9 (unsure -> pick hotspot!)
  • First argument: Link to server download
  • Second argument: MD5 of server download
  • You are done

Example: docker run [...] jusito/docker-ftb-alpine:8jre-alpine-hotspot "https://media.forgecdn.net...server.zip" "*md5 of server*"

Environment Variables

Example: docker [...] -e JAVA_PARAMETERS="-Xms4G -Xmx4G" [...] jusito/docker-ftb-alpine:*TAG*

JAVA_PARAMETERS (JVM Arguments, Performance)
  • default for hotspot -Xms4G -Xmx4G -XX:+UnlockExperimentalVMOptions -XX:+UseG1GC -XX:+UseStringDeduplication -XX:+UseCGroupMemoryLimitForHeap
  • default for openj9 -Xms4096M -Xmx4096M -Xmns2048M -Xmnx3276M -Xgc:concurrentScavenge -Xgc:dnssExpectedTimeRatioMaximum=3 -Xgc:scvNoAdaptiveTenure -Xdisableexplicitgc -Xtune:virtualized
  • reddit suggestion, good for clients -XX:+UseG1GC -Xmx4G -Xms4G -Dsun.rmi.dgc.server.gcInterval=2147483646 -XX:+UnlockExperimentalVMOptions -XX:G1NewSizePercent=20 -XX:G1ReservePercent=20 -XX:MaxGCPauseMillis=50 -XX:G1HeapRegionSize=32M
  • aikar suggestion: link
  • Iam using for DDSS server: -Xms8192M -Xmx8192M -XX:+UseStringDeduplication -XX:+UseG1GC -XX:+ParallelRefProcEnabled -XX:MaxGCPauseMillis=200 -XX:+UnlockExperimentalVMOptions -XX:+DisableExplicitGC -XX:+AlwaysPreTouch -XX:G1NewSizePercent=40 -XX:G1MaxNewSizePercent=50 -XX:G1HeapRegionSize=16M -XX:G1ReservePercent=15 -XX:G1HeapWastePercent=5 -XX:G1MixedGCCountTarget=4 -XX:InitiatingHeapOccupancyPercent=20 -XX:G1MixedGCLiveThresholdPercent=90 -XX:G1RSetUpdatingPauseTimePercent=5 -XX:SurvivorRatio=32 -XX:+PerfDisableSharedMem -XX:MaxTenuringThreshold=1 -Dusing.aikars.flags=https://mcflags.emc.gs -Daikars.new.flags=true
Server Properties

Because you may want to use many environment variables, you may find --env-file helpful. The values of this environment variables are written on every restart. If you don't set them, default value is written.

NameDefaultDescription
OVERWRITE_PROPERTIEStrueserver.properties are deleted and rewritten at each restart. Unused variables remain on default. Unknown properties are deleted.

In general Propertyname = Variablename, lowercase and replace "-"&"." with "_". See below for details.

All Available Properties (click me)

NameDefaultName in server.properties
allow_flightfalseallow-flight
allow_nethertrueallow-nether
broadcast_console_to_opstruebroadcast-console-to-ops
difficulty1difficulty
enable_command_blockfalseenable-command-block
enable_jmx_monitoringfalseenable-jmx-monitoring=false
enable_queryfalseenable-query
enable_rconfalseenable-rcon
enable_statustrueenable-status
enforce_whitelistfalseenforce-whitelist
entity_broadcast_range_percentage100entity-broadcast-range-percentage
force_gamemodefalseforce-gamemode
function_permission_level2function-permission-level
gamemode0gamemode
generate_structurestruegenerate-structures
generator_settingsgenerator-settings
hardcorefalsehardcore
level_nameworldlevel-name
level_seedlevel-seed
level_typeDEFAULTlevel-type
max_build_height256max-build-height
max_players20max-players
max_tick_time60000max-tick-time
max_world_size29999984max-world-size
motdA Minecraft Server
network_compression_threshold256network-compression-threshold
online_modetrueonline-mode
op_permission_level4op-permission-level
player_idle_timeout0player-idle-timeout
prevent_proxy_connectionsfalseprevent-proxy-connections
pvptruepvp
query_port25565query.port
rate_limit0rate-limit
rcon_passwordrcon.password
rcon_port25575rcon.port
resource_packresource-pack
resource_pack_sha1resource-pack-sha1
server_ipserver-ip
server_port25565server-port
snooper_enabledtruesnooper-enabled
spawn_animalstruespawn-animals
spawn_monsterstruespawn-monsters
spawn_npcstruespawn-npcs
spawn_protection16spawn-protection
sync_chunk_writestruesync-chunk-writes
view_distance10view-distance
white_listfalsewhite-list

access server console

docker exec -it CONTAINER query

  • show - view last 50 log lines
  • end - end query
  • help - call help in serverquery
  • stop - call stop in serverquery
  • *every other serverquery command*
Healthcheck

This container is using a health check default. It checks every 10s if the server status is available. If you don't want this use: --no-healthcheck

NameDefaultDescription
HEALTH_URL127.0.0.1Target address for healthcheck. Maybe you want to add your external address.
HEALTH_PORTread from server.propertiesTarget port for healthcheck.
additional config
NameDefaultDescription
FORCE_DOWNLOADfalseWhether the server should be downloaded every time it is restarted.
ADMIN_NAMESet here your first admin level 4 name. This will allow you to change config ingame.
DEBUGGINGfalseIf true xtrace is set in every script. Very verbose!
FORGE_VERSIONForce forge version because this images always ignore the shipped forge jars (if not exact vesion configured for the image).
Internal Used (don't change please)
(click me)

NameDefaultDescription
MY_USER_ID10000
MY_GROUP_ID10000
MY_NAMEdocker
MY_HOME/home/docker
MY_VOLUME/home/docker
MY_FILETagDependencyName of the server file.
MY_SERVERTagDependencyDownload link of the server.
MY_MD5TagDependencyMD5 of Download.
TEST_MODEused for CI
STARTUP_TIMEOUT600timeout for TEST_MODE

Additional Informations

Volumes
  • /home/docker
Useful File Locations
  • /home/docker/config/ Mod configs
  • /home/docker/logs/ FTB logs
  • /home/docker/mods/ Mod folder
  • /home/docker/server.properties
  • /home/docker/config.sh your personal config
  • /home/addOp.sh script you can use for adding op.
add Operator

You can use the ingame command, if you don't like it: docker exec "CONTAINER" /home/addOp.sh "uuid" "name" "level" "bypassesPlayerLimit"

  • uuid can be empty, will be resolved
  • name is needed
  • level if unset 4
  • bypassesPlayerLimit if unset true
  • docker restart CONTAINER needed
Use your existing server.properties
  1. Step 1 & 2 can be done with copyToVolume.sh from tools section on git.
  2. Create a volume where "server.properties" is at root location.
  3. Set uid gid permissions on 10000.
  4. start container with volume and -e OVERWRITE_PROPERTIES=false
persistent files on update
  • banned-ips.json
  • banned-players.json
  • config.sh (if existing)
  • ops.json
  • server.properties
  • usercache.json
  • usernamecache.json
  • whitelist.json
cleared on update
  • mods/*
  • config/*
  • scripts/*
  • structures/*
migrate server

You can use copyToVolume.sh from tools section on git. Examples below will result in a ready to go volume named "NewMCVolume". Download copyToVolume.sh, script is ash / bash compatible and only needs docker, no bind mount perm. needed.

Migration current statusNeededCommandResult
Existing volume with your server files. Files are at VOLUME/server.propertiesName of the volume, MyMCVolume.bash copyToVolume.sh MyMCVolume volume NewMCVolume 10000 10000NewMCVolume is ready to go
Existing folder at host. Files are at FOLDER/server.propertiesPath to the folder, /home/jusito/MCServer/server.properties.bash copyToVolume.sh '/home/jusito/MCServer/*' path NewMCVolume 10000 10000NewMCVolume is ready to go
Own Scripts
  • /home/docker/config.sh, care because only alpine + busybox, no Bash, no PCRE
Resources needed / Problem resolve

4GB RAM and 4 CPUs with lower priority should be enough on a small server. In general you should set a container limit for CPU / RAM. --memory="4096m" --cpu-shares=1024 --cpus=4 --blkio-weight 125 If you use this, with the help of OpenJDK you can replace options like -Xmx4G -XX:ParallelGCThreads=5 -XX:MinHeapFreeRatio=5 -XX:MaxHeapFreeRatio=10 with -XX:+UnlockExperimentalVMOptions -XX:+UseCGroupMemoryLimitForHeap OpenJDK Make JVM respect CPU and RAM limits OpenJDK will then make optimal use of the resources.

To understand whats wrong with your performance, you should know that the Garbage Collector (GC) in Java 8 stops everything if working. Thats because the default GC is for throughput not low latency, the default one in Java 8 is using only one thread for this. For example if you see lags ingame, like Mobs stopping for a second and are instant at your location, your problem is the GC. Java Low Latency If the lag occures like every second, you need more RAM -Xms -Xmx. If the lag isn't every second but very long, you want better multithreading for GC -XX:+UseParNewGC (FTB recommends this) or -XX:+UseG1GC (Oracle recommends this Oracle). This is basic stuff ofc there is a lot more, just search for "jvm low latency".

Is this working?

The label at the top of this document updates every week. If you want to test it on your own:

  1. Clone Repository & install shellcheck
  2. Navigate to root dir of repo
  3. [Optional] Create Dockerfile for your modpack, just copy another FTB Dockerfile (if jar see vanilla, if zip see others, twitch forge see RLCraft), replace download & md5
  4. bash test/testCaseQuick.sh "Vanilla-1.15.2" or bash test/testCaseAll.sh
  5. [Optional] If you want more details, export DEBUGGING=true (xtrace activated everywhere)

Hint: If you want to test Modpack A in Version B, Dockerfile should be at "modpacks/A/B/Dockerfile" and you can test it with bash test/testCaseQuick.sh "A-B". For A:=Vanilla and B:=1.15.2 this would be "modpacks/Vanilla/1.15.2/Dockerfile" and image name used for testing "Vanilla-1.15.2".

FTP Server

  • If your Volume is MyMinecraftVolume
  • If you didn't change UserID / GroupID
  • If you want to connect to ftp://...:123 (ports 122/123 are free on your network)
For FileZilla
docker run -d \
 -e MY_NAME="docker" -e MY_PASSWORD="MySecurePW" \
 -e MY_USER_ID="10000" -e MY_GROUP_ID="10000" \
 -p 122:20 -p 123:21 -p 10090-10100:10090-10100 \
 -v MyMinecraftVolume:/home/docker/ \
 jusito/vsftpd-alpine:simple
For Windows Network Mount
  • IP of the Host (not container) 1.2.3.4
  • Mount: ftp://1.2.3.4:123
docker run -d \
 -e MY_NAME="docker" -e MY_PASSWORD="MySecurePW" \
 -e MY_USER_ID="10000" -e MY_GROUP_ID="10000" \
 -p 122:20 -p 123:21 -p 10090-10100:10090-10100 \
 -v MyMinecraftVolume:/home/docker/ \
 -e pasv_address="1.2.3.4" \
 jusito/vsftpd-alpine:simple

Contributing / Requesting

Create a git issue or see maintainer label, I don't check everytime for newer version but I can easily push a new tag

Acknowledgments

Tag summary

Content type

Image

Digest

sha256:8e070889b

Size

49.2 MB

Last updated

over 1 year ago

docker pull jusito/docker-ftb-alpine:master