在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称(OpenSource Name):awesome-release/docker-minecraft-server开源软件地址(OpenSource Url):https://github.com/awesome-release/docker-minecraft-server开源编程语言(OpenSource Language):Shell 95.2%开源软件介绍(OpenSource Introduction):Verified to work in ReleaseThis project is based on https://github.com/itzg/docker-minecraft-server No modifications were necessary for this project to run in Release. However, in the Release Application Template it is necessary to adjust a few things. First, create an ELB to expose port 25565 with a simple hostname under the minecraft service. The minecraft service section of your Application Template should look like this:
This will expose port 25565 directly via an ELB to the Internet. You should also increase the memory available for this container in Release by editing the resources section of your Applicaiton Template. In this example I've used 3Gb.
For more information on editing a Release Application Template, please refer to the documentation: Release Application Template Documentation. This docker image provides a Minecraft Server that will automatically download the latest stable version at startup. You can also run/upgrade to any specific version or the latest snapshot. See the Versions section below for more information. To simply use the latest stable version, run
where the standard server port, 25565, will be exposed on your host machine. If you want to serve up multiple Minecraft servers or just use an alternate port, change the host-side port mapping such as
will serve your Minecraft server on your host's port 25566 since the Speaking of multiple servers, it's handy to give your containers explicit names using
With that you can easily view the logs, stop, or re-start the container:
Be sure to always include Looking for a Bedrock Dedicated ServerFor Minecraft clients running on consoles, mobile, or native Windows, you'll need to use this image instead: Interacting with the serverRCON is enabled by default, so you can
Note: The To run a simple, one-shot command, such as stopping a Minecraft server, pass the command as
arguments to
The In order to attach and interact with the Minecraft server, add
With that you can attach and interact at any time using
and then Control-p Control-q to detach. For remote access, configure your Docker daemon to use a
Unless you're on a home/private LAN, you should enable TLS access. EULA SupportMojang now requires accepting the Minecraft EULA. To accept add
such as
Timezone ConfigurationYou can configure the timezone to match yours by setting the
such as:
Or mounting
such as:
Attaching data directory to host filesystemIn order to readily access the Minecraft data, use the
When attached in this way you can stop the server, edit the configuration under your attached VersionsTo use a different Minecraft version, pass the
For example, to use the latest snapshot:
or a specific version:
When using "LATEST" or "SNAPSHOT" an upgrade can be performed by simply restarting the container.
During the next startup, if a newer version is available from the respective release channel, then
the new server jar file is downloaded and used. NOTE: over time you might see older versions of
the server jar remain in the Running Minecraft server on different Java versionTo use a different version of Java, please use a docker tag to run your Minecraft server.
For example, to use a Java version 13:
Keep in mind that some versions of Minecraft server can't work on the newest versions of Java. Also, FORGE doesn't support openj9 JVM implementation. HealthcheckThis image contains mc-monitor and uses
its
You can also query the container's health in a script friendly way:
Some orchestration systems, such as Portainer, don't allow for disabling the default Autopause (experimental)Description
There are various bug reports on Mojang about high CPU usage of servers with newer versions, even with few or no clients connected (e.g. this one, in fact the functionality is based on this comment in the thread). An autopause functionality has been added to this image to monitor whether clients are connected to the server. If for a specified time no client is connected, the Java process is stopped. When knocking on the server port (e.g. by the ingame Multiplayer server overview), the process is resumed. The experience for the client does not change. Of course, even loaded chunks are not ticked when the process is stopped. From the server's point of view, the pausing causes a single tick to take as long as the process is stopped, so the server watchdog might intervene after the process is continued, possibly forcing a container restart. To prevent this, ensure that the On startup the A starting, example compose file has been provided in examples/docker-compose-autopause.yml. Enabling AutopauseEnable the Autopause functionality by setting:
There are 4 more environment variables that define the behaviour:
Deployment Templates and ExamplesHelm ChartsExamplesThe examples directory also provides examples of deploying the itzg/minecraft-server Docker image. Amazon Web Services (AWS) DeploymentIf you're looking for a simple way to deploy this to the Amazon Web Services Cloud, check out the Minecraft Server Deployment (CloudFormation) repository. This repository contains a CloudFormation template that will get you up and running in AWS in a matter of minutes. Optionally it uses Spot Pricing so the server is very cheap, and you can easily turn it off when not in use. Running a Forge ServerEnable Forge server mode by adding a
To use a pre-downloaded Forge installer, place it in the attached
To download a Forge installer from a custom location, such as your own file repository, specify
the URL with
In both of the cases above, there is no need for the In order to add mods, you have two options. Using the /data volumeThis is the easiest way if you are using a persistent To do this, you will need to attach the container's
Providing a presistent For instance, imagine a scenario when the initial launch has completed, but you now want to change the worldmap for your server. Assuming you have a shared directory to your container, you can then (after first launch) drag and drop your premade maps or worlds into the Once your maps are in the proper path, you can then specify which map the server uses by changing the If you add mods or make changes to
Using separate mountsThis is the easiest way if you are using an ephemeral There are two additional volumes that can be mounted; This works well if you want to have a common set of modules in a separate location, but still have multiple worlds with different server requirements in either persistent volumes or a downloadable archive. Replacing variables inside configsSometimes you have mods or plugins that require configuration information that is only available at runtime. For example if you need to configure a plugin to connect to a database, you don't want to include this information in your Git repository or Docker image. Or maybe you have some runtime information like the server name that needs to be set in your config files after the container starts. For those cases there is the option to replace defined variables inside your configs with environment variables defined at container runtime. If you set the enviroment variable Optionally you can also define a prefix to only match predefined environment variables.
If you want use file for value (like when use secrets) you can add suffix There are some limitations to what characters you can use.
Variables will be replaced in files with the following extensions:
Specific files can be excluded by listing their name (without path) in the variable Paths can be excluded by listing them in the variable
Here is a full example where we want to replace values inside a ---
database:
host: ${CFG_DB_HOST}
name: ${CFG_DB_NAME}
password: ${CFG_DB_PASSWORD} This is how your version: "3"
# Other docker-compose examples in /examples
services:
minecraft:
image: itzg/minecraft-server
ports:
- "25565:25565"
volumes:
- "mc:/data"
environment:
EULA: "TRUE"
ENABLE_RCON: "true"
RCON_PASSWORD: "testing"
RCON_PORT: 28016
# enable env variable replacement
REPLACE_ENV_VARIABLES: "TRUE"
# define an optional prefix for your env variables you want to replace
ENV_VARIABLE_PREFIX: "CFG_"
# and here are the actual variables
CFG_DB_HOST: "http://localhost:3306"
CFG_DB_NAME: "minecraft"
CFG_DB_PASSWORD_FILE: "/run/secrets/db_password"
restart: always
rcon:
image: itzg/rcon
ports:
- "4326:4326"
- "4327:4327"
volumes:
- "rcon:/opt/rcon-web-admin/db"
volumes:
mc:
rcon:
secrets:
db_password:
file: ./db_password The content of
Running a Bukkit/Spigot serverEnable Bukkit/Spigot server mode by adding a
If you are hosting your own copy of Bukkit/Spigot you can override the download URLs with:
You can build spigot from source by adding If you have attached a host directory to the Running a Paper serverEnable Paper server mode by adding a By default the container will run the latest build of Paper server
but you can also choose to run a specific build with
If you are hosting your own copy of Paper you can override the download URL with:
An example compose file is provided at examples/docker-compose-paper.yml. If you have attached a host directory to the Running a Tuinity serverA Tuinity server, which is a fork of Paper aimed at improving server performance at high playercounts.
Running a Magma serverA Magma server, which is a combination of Forge and PaperMC, can be used with
Running a Mohist serverA Mohist server can be used with
Running a Catserver type serverA Catserver type server can be used with
Running a server with a Feed the Beast modpack
Feed the Beast application modpacks are supported by using Environment Variables:
UpgradingIf a specific ExampleThe following example runs the latest version of FTB Presents Direwolf20 1.12:
Running a server with a CurseForge modpackEnable this server mode by adding You need to specify a modpack to run, using the Now you can add a
If you want to keep the pre-download modpacks separate from your data directory,
then you can attach another volume at a path of your choosing and reference that.
The following example uses
Buggy start scripts |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论