OhMyMCOhMyMC

环境变量表

16 次阅读

注意

此页面列出的变量是手动记录的,可能已过时或不准确。

所有其他文档页面都正在积极维护,因此请使用上面的搜索框来查找所需的主题。

常规配置

变量名说明默认值是否必须
UID容器运行时使用的 Linux 用户 ID1000⬜️
GID容器运行时使用的 Linux 组1000⬜️
MEMORY该映像声明初始和最大Java内存堆限制为1GB。1G⬜️
INIT_MEMORY独立设置初始堆大小1G⬜️
MAX_MEMORY独立设置最大堆大小1G⬜️
TZ您可以通过设置TZ环境变量来配置时区以匹配您的时区。或者也可以挂载: /etc/localtime:/etc/localtime:ro /etc/timezone:/etc/timezone:ro UTC⬜️
ENABLE_ROLLING_LOGS默认情况下,日志文件只有一个并无限增长。通过将其设置为true,可以将记录器重新配置为使用滚动日志文件策略truefalse⬜️
ENABLE_JMXTo enable remote JMX, such as for profiling with VisualVM or JMC, add the environment variable ENABLE_JMX=truefalse⬜️
JMX_HOSTIf JMX is enabled, set JMX_HOST to the IP/host running the Docker container, and add a port forwarding of TCP port 7091⬜️
USE_AIKAR_FLAGSAikar has done some research into finding the optimal JVM flags for GC tuning, which becomes more important as more users are connected concurrentlyfalse⬜️
JVM_OPTSGeneral JVM options can be passed to the Minecraft Server invocation by passing a JVM_OPTS environment variable. The JVM requires -XX options to precede -X options, so those can be declared in JVM_XX_OPTS. Both variables are space-delimited, raw JVM arguments⬜️
JVM_XX_OPTSGeneral JVM options can be passed to the Minecraft Server invocation by passing a JVM_OPTS environment variable. The JVM requires -XX options to precede -X options, so those can be declared in JVM_XX_OPTS. Both variables are space-delimited, raw JVM arguments⬜️
JVM_DD_OPTSAs a shorthand for passing several system properties as -D arguments, you can instead pass a comma separated list of name=value or name:value pairs with JVM_DD_OPTS. (The colon syntax is provided for management platforms like Plesk that don't allow = inside a value.)⬜️
EXTRA_ARGSArguments that would usually be passed to the jar file (those which are written after the filename)⬜️
LOG_TIMESTAMP To include the timestamp with each log set to truefalse⬜️

Server

NAMEDESCRIPTIONDEFAULTREQUIRED
TYPEThe server typeVANILLA⬜️
EULAYou MUST set this to true 
VERSIONThe minecraft versionLATEST⬜️
MOTDSet the server log in message.⬜️
DIFFICULTYThe difficulty level. Available values: peaceful,easy,normal,hardeasy⬜️
ICONThe url or file path for the icon image to use for the server. It will be downloaded, scaled, and converted to the proper format.⬜️
OVERRIDE_ICONThe server icon which has been set doesn't get overridden by default. Set this to TRUE to override the iconFALSE⬜️
MAX_PLAYERSThe maximum number of players that can join the server.20⬜️
MAX_WORLD_SIZEThe maximum possible size in blocks, expressed as a radius.⬜️
ALLOW_NETHERAllows players to travel to the Nethertrue⬜️
ANNOUNCE_PLAYER_ACHIEVEMENTSAllows server to announce when a player gets an achievement.true⬜️
ENABLE_COMMAND_BLOCKEnables the command blocks.⬜️
FORCE_GAMEMODEForce players to join in the default game mode.false⬜️
GENERATE_STRUCTURESDefines whether structures (such as villages) will be generated.true⬜️
HARDCOREIf set to true, players will be set to spectator mode if they die.false⬜️
SNOOPER_ENABLEDIf set to false, the server will not send data to snoop.minecraft.net server.true⬜️
MAX_BUILD_HEIGHTThe maximum height in which building is allowed. Terrain may still naturally generate above a low height limit.256⬜️
SPAWN_ANIMALSDetermines if animals will be able to spawn.true⬜️
SPAWN_MONSTERSDetermines if monsters will be spawned.true⬜️
SPAWN_NPCSDetermines if villagers will be spawned.true⬜️
SPAWN_PROTECTIONSets the area that non-ops can not edit (0 to disable)⬜️
VIEW_DISTANCESets the amount of world data the server sends the client, measured in chunks in each direction of the player (radius, not diameter). It determines the server-side viewing distance.⬜️
SEEDSets the seed to create the Minecraft world. If you use a negative number, make sure that it is in quotes.⬜️
MODEMinecraft servers are configured to run in Survival mode by default. You can change the mode using MODE where you can either provide the standard numerical values or the shortcut values:
  • creative
  • survival
  • adventure
  • spectator(minecraft 1.8 or later)
⬜️
PVPBy default, servers are created with player-vs-player (PVP) mode enabled.true⬜️
LEVEL_TYPEBy default, a standard world is generated with hills, valleys, water, etc. A different level type can be configured by setting LEVEL_TYPE to an expected type listed here. minecraft:default⬜️
GENERATOR_SETTINGSFor some of the level types, GENERATOR_SETTINGS can be used to further customize the world generation as described here.⬜️
LEVELYou can either switch between world saves or run multiple containers with different saves by using the LEVEL optionworld⬜️
ONLINE_MODEBy default, server checks connecting players against Minecraft's account database. If you want to create an offline server or your server is not connected to the internet, you can disable the server to try connecting to minecraft.net to authenticate playerstrue⬜️
ALLOW_FLIGHTAllows users to use flight on your server while in Survival mode, if they have a mod that provides flight installed.FALSE⬜️
SERVER_NAMEThe server name⬜️
SERVER_PORTOnly change this value if you know what you're doing. It is only needed when using host networking and it is rare that host networking should be used.⬜️
PLAYER_IDLE_TIMEOUTplayer-idle-timeout⬜️
ENABLE_JMXenable-jmx-monitoring⬜️
SYNC_CHUNK_WRITESsync-chunk-writes⬜️
ENABLE_STATUSenable-status⬜️
ENTITY_BROADCAST_RANGE_PERCENTAGEentity-broadcast-range-percentage⬜️
FUNCTION_PERMISSION_LEVELfunction-permission-level⬜️
NETWORK_COMPRESSION_THRESHOLDnetwork-compression-threshold⬜️
OP_PERMISSION_LEVELop-permission-level⬜️
PREVENT_PROXY_CONNECTIONSprevent-proxy-connections⬜️
USE_NATIVE_TRANSPORTuse-native-transport⬜️
SIMULATION_DISTANCEsimulation-distance⬜️
EXEC_DIRECTLYIf you would like to docker attach to the Minecraft server console with color and interactive capabilities, then set to truefalse⬜️
STOP_SERVER_ANNOUNCE_DELAYTo allow time for players to finish what they're doing during a graceful server shutdown, set STOP_SERVER_ANNOUNCE_DELAY to a number of seconds to delay after an announcement is posted by the server.⬜️
PROXYYou may configure the use of an HTTP/HTTPS proxy by passing the proxy's URLfalse⬜️
CONSOLESome older versions (pre-1.14) of Spigot required --noconsole to be passed when detaching stdinTRUE⬜️
GUISome older servers get confused and think that the GUI interface is enabled.TRUE⬜️
STOP_DURATIONWhen the container is signalled to stop, the Minecraft process wrapper will attempt to send a "stop" command via RCON or console and waits for the process to gracefully finish.60⬜️
SETUP_ONLYIf you are using a host-attached data directory, then you can have the image setup the Minecraft server files and stop prior to launching the server process by setting this to truefalse⬜️
USE_FLARE_FLAGSTo enable the JVM flags required to fully support the Flare profiling suite.⬜️
USE_SIMD_FLAGSSupport for optimized SIMD operationfalse⬜️

自定义资源包

NAMEDESCRIPTIONDEFAULTREQUIRED
RESOURCE_PACKA link to a custom resource pack⬜️
RESOURCE_PACK_SHA1The checksum for the custom resource pack⬜️
RESOURCE_PACK_ENFORCEEnforce the resource pack on clientsFALSE⬜️

白名单列表

NAMEDESCRIPTIONDEFAULTREQUIRED
ENABLE_WHITELISTEnable the whitelist to manually manage the whitelistfalse⬜️
WHITELISTA list of usernames and/or UUIDs separated by comma⬜️
WHITELIST_FILEA url or file path to a whitelist json formatted file.⬜️
OVERRIDE_WHITELISTEnforce regeneration of the whitelist on each server startup.false⬜️

RCON

NAMEDESCRIPTIONDEFAULTREQUIRED
ENABLE_RCONEnable/disable RCON support; however, be aware that disabling RCON will remove and limit some features, such as interactive and color console support.true⬜️
RCON_PASSWORDYou MUST change this valueRandomly generated
RCON_PORTThe port for RCON25575⬜️
BROADCAST_RCON_TO_OPSSets broadcast-rcon-to-ops server propertyfalse⬜️
RCON_CMDS_STARTUPRCON commands to execute when the server starts.⬜️
RCON_CMDS_ON_CONNECTRCON commands to execute whenever a client connects to the server.⬜️
RCON_CMDS_FIRST_CONNECTRCON commands to execute on the first client connection to the server.⬜️
RCON_CMDS_ON_DISCONNECTRCON commands to execute whenever a client disconnects from the server.⬜️
RCON_CMDS_LAST_DISCONNECTRCON commands to execute when the last client disconnects from the server.⬜️

自动暂停

备注

Autopause 与 EXEC_DIRECTLY=true 不兼容,两者不可以一起设置。

NAMEDESCRIPTIONDEFAULTREQUIRED
ENABLE_AUTOPAUSEEnable the Autopause functionalityFALSE⬜️
AUTOPAUSE_TIMEOUT_ESTdescribes the time between the last client disconnect and the pausing of the process3600⬜️
AUTOPAUSE_TIMEOUT_INITdescribes the time between server start and the pausing of the process, when no client connects in-between600⬜️
AUTOPAUSE_TIMEOUT_KNdescribes the time between knocking of the port (e.g. by the main menu ping) and the pausing of the process, when no client connects in-between120⬜️
AUTOPAUSE_PERIODdescribes period of the daemonized state machine, that handles the pausing of the process10⬜️
AUTOPAUSE_KNOCK_INTERFACEDescribes the interface passed to the knockd daemon. If the default interface does not work, run the ifconfig command inside the container and derive the interface receiving the incoming connection from its output. The passed interface must exist inside the container. Using the loopback interface (lo) does likely not yield the desired results.eth0⬜️
DEBUG_AUTOPAUSEAdds additional debugging output for AutoPausefalse⬜️

自动停止

备注

自动停止和自动暂停功能不兼容。

NAMEDESCRIPTIONDEFAULTREQUIRED
ENABLE_AUTOSTOPEnable the AutoStop functionalityFALSE⬜️
AUTOSTOP_TIMEOUT_ESTdescribes the time between the last client disconnect and the stopping of the server3600⬜️
AUTOSTOP_TIMEOUT_INITdescribes the time between server start and the stopping of the server, when no client connects in-between1800⬜️
AUTOSTOP_PERIODdescribes period of the daemonized state machine, that handles the stopping of the serve10⬜️
DEBUG_AUTOSTOPAdds additional logging for AutoStopfalse⬜️

CurseForge

技巧

请参阅 CurseForge文档页面 以获取更多详细信息和最新信息。

NAMEDESCRIPTIONDEFAULTREQUIRED
CF_API_KEYYOUR CurseForge (Eternal) API Key.
CF_PAGE_URLPass a page URL to the modpack or a specific file⬜️
CF_SLUGInstead of a URL, the modpack slug can be provided.⬜️
CF_FILE_IDThe mod curseforge numerical ID.⬜️
CF_FILENAME_MATCHERSpecify a substring to match the desired filename⬜️
CF_EXCLUDE_INCLUDE_FILEGlobal and per modpack exclusions can be declared in a JSON file and referenced with this variable.

By default, the file bundled with the image will be used, but can be disabled by setting this to an empty string. The schema of this file is documented here.
⬜️
CF_EXCLUDE_MODSMods can be excluded by passing a comma or space delimited list of project slugs or IDs⬜️
CF_FORCE_INCLUDE_MODSMods can be included by passing a comma or space delimited list of project slugs or IDs⬜️
CF_FORCE_SYNCHRONIZEForces the excludes/includes to be re-evaluated⬜️
CF_SET_LEVEL_FROMSome modpacks come with world/save data via a worlds file and/or the overrides provided with the modpack. Either approach can be selected to set the LEVEL to the resulting saves directory by setting this to either:
  • WORLD_FILE
  • OVERRIDES
⬜️
CF_PARALLEL_DOWNLOADSspecify how many parallel mod downloads to perform4⬜️
CF_OVERRIDES_SKIP_EXISTINGif set, files in the overrides that already exist in the data directory are skipped. world data is always skipped, if present.false⬜️

最后更新于