mirror of
https://github.com/itzg/docker-minecraft-server.git
synced 2026-02-17 15:13:55 +00:00
Compare commits
38 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
6ee414337a | ||
|
|
c2071e5038 | ||
|
|
02640e5414 | ||
|
|
ac806b756c | ||
|
|
605e2ea993 | ||
|
|
c9dd6dc72c | ||
|
|
d8bca85d55 | ||
|
|
3acc867f58 | ||
|
|
8463893168 | ||
|
|
5b79daa4a3 | ||
|
|
1fd1e15f3c | ||
|
|
37e08466ad | ||
|
|
1868cd05da | ||
|
|
8a7cfbfb3e | ||
|
|
e31a730d21 | ||
|
|
a36a75a790 | ||
|
|
07b10027af | ||
|
|
c72e23b4d7 | ||
|
|
5036ef5f2f | ||
|
|
37e956e517 | ||
|
|
36015d2b39 | ||
|
|
a3ac903dfe | ||
|
|
6e94f4234b | ||
|
|
9d8ab63ee5 | ||
|
|
cde239f033 | ||
|
|
8bc184cd18 | ||
|
|
3cdc86ef0b | ||
|
|
45f14512bb | ||
|
|
d402403876 | ||
|
|
9ebae54e6e | ||
|
|
19a8bcfb53 | ||
|
|
c700880bbe | ||
|
|
8c04dfd882 | ||
|
|
d8075916e3 | ||
|
|
1cf2783daf | ||
|
|
a5643cdeac | ||
|
|
12816373ea | ||
|
|
2eb66042ec |
22
.github/workflows/build-multiarch.yml
vendored
22
.github/workflows/build-multiarch.yml
vendored
@@ -29,6 +29,8 @@ jobs:
|
||||
- java17
|
||||
- java17-graalvm
|
||||
- java17-alpine
|
||||
- java16
|
||||
- java11
|
||||
- java8
|
||||
- java8-graalvm-ce
|
||||
- java8-openj9
|
||||
@@ -74,31 +76,41 @@ jobs:
|
||||
baseImage: eclipse-temurin:17-jre-alpine
|
||||
platforms: linux/amd64
|
||||
mcVersion: 1.20.4
|
||||
# JAVA 16
|
||||
- variant: java16
|
||||
baseImage: adoptopenjdk:16-jre-hotspot
|
||||
platforms: linux/amd64,linux/arm/v7,linux/arm64
|
||||
mcVersion: 1.16.5
|
||||
# JAVA 11
|
||||
- variant: java11
|
||||
baseImage: adoptopenjdk:11-jre-hotspot
|
||||
platforms: linux/amd64,linux/arm/v7,linux/arm64
|
||||
mcVersion: 1.16.4
|
||||
# JAVA 8: NOTE: Unable to go past 8u312 because of Forge dependencies
|
||||
- variant: java8
|
||||
baseImage: eclipse-temurin:8u312-b07-jre-focal
|
||||
platforms: linux/amd64,linux/arm/v7,linux/arm64
|
||||
mcVersion: 1.12.2
|
||||
# Pin version for Java 8
|
||||
mcHelperVersion: 1.42.1
|
||||
# mcHelperVersion: 1.46.0
|
||||
- variant: java8-graalvm-ce
|
||||
baseImage: ghcr.io/graalvm/graalvm-ce:java8
|
||||
platforms: linux/amd64
|
||||
mcVersion: 1.12.2
|
||||
# Pin version for Java 8
|
||||
mcHelperVersion: 1.42.1
|
||||
# mcHelperVersion: 1.46.0
|
||||
- variant: java8-jdk
|
||||
baseImage: eclipse-temurin:8u312-b07-jdk-focal
|
||||
platforms: linux/amd64,linux/arm64
|
||||
mcVersion: 1.12.2
|
||||
# Pin version for Java 8
|
||||
mcHelperVersion: 1.42.1
|
||||
# mcHelperVersion: 1.46.0
|
||||
- variant: java8-openj9
|
||||
baseImage: ibm-semeru-runtimes:open-8u312-b07-jre
|
||||
platforms: linux/amd64,linux/arm64
|
||||
mcVersion: 1.12.2
|
||||
# Pin version for Java 8
|
||||
mcHelperVersion: 1.42.1
|
||||
# mcHelperVersion: 1.46.0
|
||||
env:
|
||||
IMAGE_TO_TEST: "${{ github.repository_owner }}/minecraft-server:test-${{ matrix.variant }}-${{ github.run_id }}"
|
||||
HAS_IMAGE_REPO_ACCESS: ${{ secrets.DOCKER_USER != '' && secrets.DOCKER_PASSWORD != '' }}
|
||||
@@ -143,7 +155,7 @@ jobs:
|
||||
org.opencontainers.image.authors=Geoff Bourne <itzgeoff@gmail.com>
|
||||
|
||||
- name: Setup Docker Buildx
|
||||
uses: docker/setup-buildx-action@v3.10.0
|
||||
uses: docker/setup-buildx-action@v3.11.1
|
||||
|
||||
- name: Set up QEMU
|
||||
uses: docker/setup-qemu-action@v3.6.0
|
||||
|
||||
2
.github/workflows/discord.yml
vendored
2
.github/workflows/discord.yml
vendored
@@ -19,7 +19,7 @@ jobs:
|
||||
steps:
|
||||
- name: on-publish
|
||||
if: github.event_name == 'release' && github.event.action == 'published'
|
||||
uses: SethCohen/github-releases-to-discord@v1.16.2
|
||||
uses: SethCohen/github-releases-to-discord@v1.19.0
|
||||
with:
|
||||
webhook_url: ${{ secrets.DISCORD_WEBHOOK }}
|
||||
- name: on-success
|
||||
|
||||
2
.github/workflows/verify-pr.yml
vendored
2
.github/workflows/verify-pr.yml
vendored
@@ -55,7 +55,7 @@ jobs:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Setup Docker Buildx
|
||||
uses: docker/setup-buildx-action@v3.10.0
|
||||
uses: docker/setup-buildx-action@v3.11.1
|
||||
|
||||
- name: Confirm multi-arch build
|
||||
uses: docker/build-push-action@v6.18.0
|
||||
|
||||
12
Dockerfile
12
Dockerfile
@@ -24,31 +24,31 @@ EXPOSE 25565
|
||||
ARG APPS_REV=1
|
||||
ARG GITHUB_BASEURL=https://github.com
|
||||
|
||||
ARG EASY_ADD_VERSION=0.8.10
|
||||
ARG EASY_ADD_VERSION=0.8.11
|
||||
ADD ${GITHUB_BASEURL}/itzg/easy-add/releases/download/${EASY_ADD_VERSION}/easy-add_${TARGETOS}_${TARGETARCH}${TARGETVARIANT} /usr/bin/easy-add
|
||||
RUN chmod +x /usr/bin/easy-add
|
||||
|
||||
ARG RESTIFY_VERSION=1.7.9
|
||||
ARG RESTIFY_VERSION=1.7.10
|
||||
RUN easy-add --var os=${TARGETOS} --var arch=${TARGETARCH}${TARGETVARIANT} \
|
||||
--var version=${RESTIFY_VERSION} --var app=restify --file {{.app}} \
|
||||
--from ${GITHUB_BASEURL}/itzg/{{.app}}/releases/download/{{.version}}/{{.app}}_{{.version}}_{{.os}}_{{.arch}}.tar.gz
|
||||
|
||||
ARG RCON_CLI_VERSION=1.7.0
|
||||
ARG RCON_CLI_VERSION=1.7.1
|
||||
RUN easy-add --var os=${TARGETOS} --var arch=${TARGETARCH}${TARGETVARIANT} \
|
||||
--var version=${RCON_CLI_VERSION} --var app=rcon-cli --file {{.app}} \
|
||||
--from ${GITHUB_BASEURL}/itzg/{{.app}}/releases/download/{{.version}}/{{.app}}_{{.version}}_{{.os}}_{{.arch}}.tar.gz
|
||||
|
||||
ARG MC_MONITOR_VERSION=0.15.5
|
||||
ARG MC_MONITOR_VERSION=0.15.6
|
||||
RUN easy-add --var os=${TARGETOS} --var arch=${TARGETARCH}${TARGETVARIANT} \
|
||||
--var version=${MC_MONITOR_VERSION} --var app=mc-monitor --file {{.app}} \
|
||||
--from ${GITHUB_BASEURL}/itzg/{{.app}}/releases/download/{{.version}}/{{.app}}_{{.version}}_{{.os}}_{{.arch}}.tar.gz
|
||||
|
||||
ARG MC_SERVER_RUNNER_VERSION=1.12.6
|
||||
ARG MC_SERVER_RUNNER_VERSION=1.13.1
|
||||
RUN easy-add --var os=${TARGETOS} --var arch=${TARGETARCH}${TARGETVARIANT} \
|
||||
--var version=${MC_SERVER_RUNNER_VERSION} --var app=mc-server-runner --file {{.app}} \
|
||||
--from ${GITHUB_BASEURL}/itzg/{{.app}}/releases/download/{{.version}}/{{.app}}_{{.version}}_{{.os}}_{{.arch}}.tar.gz
|
||||
|
||||
ARG MC_HELPER_VERSION=1.42.3
|
||||
ARG MC_HELPER_VERSION=1.48.1
|
||||
ARG MC_HELPER_BASE_URL=${GITHUB_BASEURL}/itzg/mc-image-helper/releases/download/${MC_HELPER_VERSION}
|
||||
# used for cache busting local copy of mc-image-helper
|
||||
ARG MC_HELPER_REV=1
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
FROM python:3.9
|
||||
FROM python:3.11
|
||||
|
||||
RUN pip install --upgrade pip
|
||||
|
||||
|
||||
@@ -50,9 +50,17 @@ In order to attach and interact with the Minecraft server make sure to enable TT
|
||||
tty: true
|
||||
```
|
||||
|
||||
With that you can attach and interact at any time using
|
||||
With that you can attach and interact at any time using the following, replacing the `{...}` placeholders.
|
||||
|
||||
docker attach mc
|
||||
...when container is created with `docker run`
|
||||
```
|
||||
docker attach {container name or ID}
|
||||
```
|
||||
|
||||
...or when declared using a compose file
|
||||
```
|
||||
docker compose attach {service name}
|
||||
```
|
||||
|
||||
and then Control-p Control-q to **detach**.
|
||||
|
||||
|
||||
@@ -84,9 +84,19 @@ To produce a multi-line MOTD, embed a newline character as `\n` in the string, s
|
||||
# MOTD: "line one\nline two"
|
||||
```
|
||||
|
||||
!!! tip
|
||||
The following example combines a multi-line MOTD with [placeholders](#placeholders) from the latest version of the installed modpack:
|
||||
|
||||
You can also embed configured and resolved environment variables using [placeholders](#placeholders).
|
||||
!!! example
|
||||
|
||||
```yaml
|
||||
MOD_PLATFORM: AUTO_CURSEFORGE
|
||||
CF_SLUG: craftoria
|
||||
MOTD: |
|
||||
A %TYPE% server on %VERSION%
|
||||
running %MODPACK_NAME% %MODPACK_VERSION%
|
||||
```
|
||||
|
||||

|
||||
|
||||
### Difficulty
|
||||
|
||||
@@ -246,125 +256,26 @@ By default, the server listens for RCON on port 25575 within the container. It c
|
||||
|
||||
### Query
|
||||
|
||||
Enabling this will enable the gamespy query protocol.
|
||||
By default the query port will be `25565` (UDP) but can easily be changed with the `QUERY_PORT` variable.
|
||||
|
||||
docker run -d -e ENABLE_QUERY=true
|
||||
|
||||
### Max players
|
||||
|
||||
By default max players is 20, you can increase this with the `MAX_PLAYERS` variable.
|
||||
|
||||
docker run -d -e MAX_PLAYERS=50
|
||||
|
||||
### Max world size
|
||||
|
||||
This sets the maximum possible size in blocks, expressed as a radius, that the world border can obtain.
|
||||
|
||||
docker run -d -e MAX_WORLD_SIZE=10000
|
||||
|
||||
### Allow Nether
|
||||
|
||||
Allows players to travel to the Nether.
|
||||
|
||||
docker run -d -e ALLOW_NETHER=true
|
||||
|
||||
### Announce Player Achievements
|
||||
|
||||
Allows server to announce when a player gets an achievement.
|
||||
|
||||
docker run -d -e ANNOUNCE_PLAYER_ACHIEVEMENTS=true
|
||||
|
||||
### Enable Command Block
|
||||
|
||||
Enables command blocks
|
||||
|
||||
docker run -d -e ENABLE_COMMAND_BLOCK=true
|
||||
|
||||
### Force Gamemode
|
||||
|
||||
Force players to join in the default game mode.
|
||||
|
||||
- false - Players will join in the gamemode they left in.
|
||||
- true - Players will always join in the default gamemode.
|
||||
|
||||
`docker run -d -e FORCE_GAMEMODE=false`
|
||||
|
||||
### Generate Structures
|
||||
|
||||
Defines whether structures (such as villages) will be generated.
|
||||
|
||||
- false - Structures will not be generated in new chunks.
|
||||
- true - Structures will be generated in new chunks.
|
||||
|
||||
`docker run -d -e GENERATE_STRUCTURES=true`
|
||||
|
||||
### Hardcore
|
||||
|
||||
If set to true, players will be set to spectator mode if they die.
|
||||
|
||||
docker run -d -e HARDCORE=false
|
||||
|
||||
### Snooper
|
||||
|
||||
If set to false, the server will not send data to snoop.minecraft.net server.
|
||||
|
||||
docker run -d -e SNOOPER_ENABLED=false
|
||||
|
||||
### Max Build Height
|
||||
|
||||
The maximum height in which building is allowed.
|
||||
Terrain may still naturally generate above a low height limit.
|
||||
|
||||
docker run -d -e MAX_BUILD_HEIGHT=256
|
||||
|
||||
### Max Tick Time
|
||||
|
||||
The maximum number of milliseconds a single tick may take before the server watchdog stops the server with the message, A single server tick took 60.00 seconds (should be max 0.05); Considering it to be crashed, server will forcibly shutdown. Once this criteria is met, it calls System.exit(1).
|
||||
Setting this to -1 will disable watchdog entirely
|
||||
|
||||
docker run -d -e MAX_TICK_TIME=60000
|
||||
|
||||
### Spawn Animals
|
||||
|
||||
Determines if animals will be able to spawn.
|
||||
|
||||
docker run -d -e SPAWN_ANIMALS=true
|
||||
|
||||
### Spawn Monsters
|
||||
|
||||
Determines if monsters will be spawned.
|
||||
|
||||
docker run -d -e SPAWN_MONSTERS=true
|
||||
|
||||
### Spawn NPCs
|
||||
|
||||
Determines if villagers will be spawned.
|
||||
|
||||
docker run -d -e SPAWN_NPCS=true
|
||||
|
||||
### Set spawn protection
|
||||
|
||||
Sets the area that non-ops can not edit (0 to disable)
|
||||
|
||||
docker run -d -e SPAWN_PROTECTION=0
|
||||
|
||||
### View Distance
|
||||
|
||||
Sets 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.
|
||||
|
||||
docker run -d -e VIEW_DISTANCE=10
|
||||
Set the environment variable `ENABLE_QUERY` to "true" to enable the gamespy query protocol. Maps to the server property [enable-query](https://minecraft.wiki/w/Server.properties#enable-query). By default, the query port will be `25565` (UDP) but can be changed with the `QUERY_PORT` environment variable.
|
||||
|
||||
### Level Seed
|
||||
|
||||
If you want to create the Minecraft level with a specific seed, use `SEED`, such as
|
||||
|
||||
-e SEED=1785852800490497919
|
||||
If you want to create the Minecraft level with a specific seed, set the environment variable `SEED`, which maps to the [level-seed](https://minecraft.wiki/w/Server.properties#level-seed) property.
|
||||
|
||||
If using a negative value for the seed, make sure to quote the value such as:
|
||||
|
||||
!!! example "Using docker run"
|
||||
|
||||
```
|
||||
-e SEED="-1785852800490497919"
|
||||
```
|
||||
|
||||
!!! example "Using compose"
|
||||
|
||||
```yaml
|
||||
environment:
|
||||
SEED: "-1785852800490497919"
|
||||
```
|
||||
|
||||
### Game Mode
|
||||
|
||||
@@ -382,13 +293,6 @@ For example:
|
||||
|
||||
docker run -d -e MODE=creative ...
|
||||
|
||||
### PVP Mode
|
||||
|
||||
By default, servers are created with player-vs-player (PVP) mode enabled. You can disable this with the `PVP`
|
||||
environment variable set to `false`, such as
|
||||
|
||||
docker run -d -e PVP=false ...
|
||||
|
||||
### Level Type and Generator Settings
|
||||
|
||||
By default, a standard world is generated with hills, valleys, water, etc. A different level type can
|
||||
@@ -408,29 +312,28 @@ Example for a superflat world:
|
||||
- Desert biome
|
||||
|
||||
```yaml
|
||||
LEVEL_TYPE: FLAT
|
||||
GENERATOR_SETTINGS: >-4
|
||||
{
|
||||
"layers": [
|
||||
{
|
||||
"block": "minecraft:bedrock",
|
||||
"height": 1
|
||||
},
|
||||
{
|
||||
"block": "minecraft:stone",
|
||||
"height": 2
|
||||
},
|
||||
{
|
||||
"block": "minecraft:sandstone",
|
||||
"height": 15
|
||||
}
|
||||
],
|
||||
"biome": "minecraft:desert"
|
||||
}
|
||||
|
||||
|
||||
environment:
|
||||
LEVEL_TYPE: FLAT
|
||||
GENERATOR_SETTINGS: >-
|
||||
{
|
||||
"layers": [
|
||||
{
|
||||
"block": "minecraft:bedrock",
|
||||
"height": 1
|
||||
},
|
||||
{
|
||||
"block": "minecraft:stone",
|
||||
"height": 2
|
||||
},
|
||||
{
|
||||
"block": "minecraft:sandstone",
|
||||
"height": 15
|
||||
}
|
||||
],
|
||||
"biome": "minecraft:desert"
|
||||
}
|
||||
```
|
||||
For more details, check the [official wiki](https://minecraft.wiki/w/Java_Edition_level_format#generatorOptions_tag_format).
|
||||
For more details, refer to the Minecraft Wiki sections for [Superflat Multiplayer](https://minecraft.wiki/w/Superflat#Multiplayer) and [generator options tag format](https://minecraft.wiki/w/Java_Edition_level_format#generatorOptions_tag_format).
|
||||
|
||||
### Custom Server Resource Pack
|
||||
|
||||
@@ -452,31 +355,24 @@ where the default is "world":
|
||||
|
||||
> **INFO** Refer to the [data directory](../data-directory.md) section for a visual description of where the `$LEVEL` directory is situated.
|
||||
|
||||
### Online mode
|
||||
|
||||
By 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 players with environment variable `ONLINE_MODE`, like this
|
||||
|
||||
docker run -d -e ONLINE_MODE=FALSE ...
|
||||
|
||||
### Allow flight
|
||||
|
||||
Allows users to use flight on your server while in Survival mode, if they have a mod that provides flight installed.
|
||||
|
||||
-e ALLOW_FLIGHT=TRUE|FALSE
|
||||
|
||||
### Server name
|
||||
|
||||
The server name (e.g. for bungeecord) can be set like:
|
||||
|
||||
docker run -d -e SERVER_NAME=MyServer ...
|
||||
|
||||
### Server port
|
||||
|
||||
> **WARNING:** only 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. Use `-p` port mappings instead.
|
||||
> **WARNING:** only change this value if you know what you're doing. It only needs to be changed when using host-networking and it is rare that host networking should be used. Use `-p` port mappings instead.
|
||||
|
||||
If you must, the server port can be set like:
|
||||
|
||||
!!! example "Using docker run"
|
||||
|
||||
```
|
||||
docker run -d -e SERVER_PORT=25566 ...
|
||||
```
|
||||
|
||||
!!! example "Using compose"
|
||||
|
||||
```yaml
|
||||
environment:
|
||||
SERVER_PORT: 25566
|
||||
```
|
||||
|
||||
**however**, be sure to change your port mapping accordingly and be prepared for some features to break.
|
||||
|
||||
@@ -500,26 +396,43 @@ When using `docker run` from a bash shell, the entries must be quoted with the `
|
||||
|
||||
### Other server property mappings
|
||||
|
||||
| Environment Variable | Server Property |
|
||||
|-----------------------------------|-----------------------------------|
|
||||
| BROADCAST_CONSOLE_TO_OPS | broadcast-console-to-ops |
|
||||
| BROADCAST_RCON_TO_OPS | broadcast-rcon-to-ops |
|
||||
| ENABLE_STATUS | enable-status |
|
||||
| ENFORCE_SECURE_PROFILE | enforce-secure-profile |
|
||||
| ENTITY_BROADCAST_RANGE_PERCENTAGE | entity-broadcast-range-percentage |
|
||||
| FUNCTION_PERMISSION_LEVEL | function-permission-level |
|
||||
| NETWORK_COMPRESSION_THRESHOLD | network-compression-threshold |
|
||||
| OP_PERMISSION_LEVEL | op-permission-level |
|
||||
| PLAYER_IDLE_TIMEOUT | player-idle-timeout |
|
||||
| PREVENT_PROXY_CONNECTIONS | prevent-proxy-connections |
|
||||
| SIMULATION_DISTANCE | simulation-distance |
|
||||
| SYNC_CHUNK_WRITES | sync-chunk-writes |
|
||||
| USE_NATIVE_TRANSPORT | use-native-transport |
|
||||
| HIDE_ONLINE_PLAYERS | hide-online-players |
|
||||
| RESOURCE_PACK_ID | resource-pack-id |
|
||||
| RESOURCE_PACK_PROMPT | resource-pack-prompt |
|
||||
| MAX_CHAINED_NEIGHBOR_UPDATES | max-chained-neighbor-updates |
|
||||
| LOG_IPS | log-ips |
|
||||
| REGION_FILE_COMPRESSION | region-file-compression |
|
||||
| BUG_REPORT_LINK | bug-report-link |
|
||||
| PAUSE_WHEN_EMPTY_SECONDS | pause-when-empty-seconds |
|
||||
| Environment Variable | Server Property |
|
||||
|-----------------------------------|-------------------------------------------------------------------------------------------------------------------|
|
||||
| ACCEPTS_TRANSFERS | [accepts-transfers](https://minecraft.wiki/w/Server.properties#accepts-transfers) |
|
||||
| ALLOW_FLIGHT | [allow-flight](https://minecraft.wiki/w/Server.properties#allow-flight) |
|
||||
| ALLOW_NETHER | [allow-nether](https://minecraft.wiki/w/Server.properties#allow-nether) |
|
||||
| BROADCAST_CONSOLE_TO_OPS | [broadcast-console-to-ops](https://minecraft.wiki/w/Server.properties#broadcast-console-to-ops) |
|
||||
| BROADCAST_RCON_TO_OPS | [broadcast-rcon-to-ops](https://minecraft.wiki/w/Server.properties#broadcast-rcon-to-ops) |
|
||||
| BUG_REPORT_LINK | [bug-report-link](https://minecraft.wiki/w/Server.properties#bug-report-link) |
|
||||
| ENABLE_COMMAND_BLOCK | [enable-command-block](https://minecraft.wiki/w/Server.properties#enable-command-block) |
|
||||
| ENABLE_STATUS | [enable-status](https://minecraft.wiki/w/Server.properties#enable-status) |
|
||||
| ENFORCE_SECURE_PROFILE | [enforce-secure-profile](https://minecraft.wiki/w/Server.properties#enforce-secure-profile) |
|
||||
| ENTITY_BROADCAST_RANGE_PERCENTAGE | [entity-broadcast-range-percentage](https://minecraft.wiki/w/Server.properties#entity-broadcast-range-percentage) |
|
||||
| FORCE_GAMEMODE | [force-gamemode](https://minecraft.wiki/w/Server.properties#force-gamemode) |
|
||||
| FUNCTION_PERMISSION_LEVEL | [function-permission-level](https://minecraft.wiki/w/Server.properties#function-permission-level) |
|
||||
| GENERATE_STRUCTURES | [generate-structures](https://minecraft.wiki/w/Server.properties#generate-structures) |
|
||||
| HARDCORE | [hardcore](https://minecraft.wiki/w/Server.properties#hardcore) |
|
||||
| HIDE_ONLINE_PLAYERS | [hide-online-players](https://minecraft.wiki/w/Server.properties#hide-online-players) |
|
||||
| LOG_IPS | [log-ips](https://minecraft.wiki/w/Server.properties#log-ips) |
|
||||
| MAX_CHAINED_NEIGHBOR_UPDATES | [max-chained-neighbor-updates](https://minecraft.wiki/w/Server.properties#max-chained-neighbor-updates) |
|
||||
| MAX_PLAYERS | [max-players](https://minecraft.wiki/w/Server.properties#max-players) |
|
||||
| MAX_TICK_TIME | [max-tick-time](https://minecraft.wiki/w/Server.properties#max-tick-time) |
|
||||
| MAX_WORLD_SIZE | [max-world-size](https://minecraft.wiki/w/Server.properties#max-world-size) |
|
||||
| NETWORK_COMPRESSION_THRESHOLD | [network-compression-threshold](https://minecraft.wiki/w/Server.properties#network-compression-threshold) |
|
||||
| ONLINE_MODE | [online-mode](https://minecraft.wiki/w/Server.properties#online-mode) |
|
||||
| OP_PERMISSION_LEVEL | [op-permission-level](https://minecraft.wiki/w/Server.properties#op-permission-level) |
|
||||
| PAUSE_WHEN_EMPTY_SECONDS | [pause-when-empty-seconds](https://minecraft.wiki/w/Server.properties#pause-when-empty-seconds) |
|
||||
| PLAYER_IDLE_TIMEOUT | [player-idle-timeout](https://minecraft.wiki/w/Server.properties#player-idle-timeout) |
|
||||
| PREVENT_PROXY_CONNECTIONS | [prevent-proxy-connections](https://minecraft.wiki/w/Server.properties#prevent-proxy-connections) |
|
||||
| PVP | [pvp](https://minecraft.wiki/w/Server.properties#pvp) |
|
||||
| RATE_LIMIT | [rate-limit](https://minecraft.wiki/w/Server.properties#rate-limit) |
|
||||
| REGION_FILE_COMPRESSION | [region-file-compression](https://minecraft.wiki/w/Server.properties#region-file-compression) |
|
||||
| RESOURCE_PACK_ID | [resource-pack-id](https://minecraft.wiki/w/Server.properties#resource-pack-id) |
|
||||
| RESOURCE_PACK_PROMPT | [resource-pack-prompt](https://minecraft.wiki/w/Server.properties#resource-pack-prompt) |
|
||||
| SERVER_NAME | [server-name](https://minecraft.wiki/w/Server.properties#server-name) |
|
||||
| SIMULATION_DISTANCE | [simulation-distance](https://minecraft.wiki/w/Server.properties#simulation-distance) |
|
||||
| SPAWN_MONSTERS | [spawn-monsters](https://minecraft.wiki/w/Server.properties#spawn-monsters) |
|
||||
| SPAWN_PROTECTION | [spawn-protection](https://minecraft.wiki/w/Server.properties#spawn-protection) |
|
||||
| SYNC_CHUNK_WRITES | [sync-chunk-writes](https://minecraft.wiki/w/Server.properties#sync-chunk-writes) |
|
||||
| USE_NATIVE_TRANSPORT | [use-native-transport](https://minecraft.wiki/w/Server.properties#use-native-transport) |
|
||||
| VIEW_DISTANCE | [view-distance](https://minecraft.wiki/w/Server.properties#view-distance) |
|
||||
BIN
docs/img/motd-with-placeholders.png
Normal file
BIN
docs/img/motd-with-placeholders.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 44 KiB |
@@ -29,7 +29,7 @@ where, in this case, the standard server port 25565, will be exposed on your hos
|
||||
|
||||
**DO NOT** port forward RCON on 25575 without first setting `RCON_PASSWORD` to a secure value. It is highly recommended to only use RCON within the container, such as with `rcon-cli`.
|
||||
|
||||
By default, the container will download the latest version of the "vanilla" [Minecraft: Java Edition server](https://www.minecraft.net/en-us/download/server) provided by Mojang. The [`VERSION`](versions/java.md) and the [`TYPE`](types-and-platforms/index.md) can be configured to create many variations of desired Minecraft server.
|
||||
By default, the container will download the latest version of the "vanilla" [Minecraft: Java Edition server](https://www.minecraft.net/en-us/download/server) provided by Mojang. The [`VERSION`](versions/minecraft.md) and the [`TYPE`](types-and-platforms/index.md) can be configured to create many variations of desired Minecraft server.
|
||||
|
||||
## Using [Docker Compose](https://docs.docker.com/compose/)
|
||||
|
||||
|
||||
@@ -1,4 +1,8 @@
|
||||
# Auto-Pause
|
||||
|
||||
!!! important
|
||||
|
||||
As of [1.21.2](https://minecraft.wiki/w/Java_Edition_1.21.2) it is not recommend to use this feature since Minecraft server natively auto-pauses when the server is empty. That is configured via the enivironment variable `PAUSE_WHEN_EMPTY_SECONDS`, which maps to the `pause-when-empty-seconds` server property.
|
||||
|
||||
An auto-pause functionality is provided that monitors whether clients are connected to the server. If a client is not connected for a specified time, the Java process is put into a pause state. When a client attempts to connect while the process is paused, then process will be restored to a running state. The experience for the client does not change. This feature can be enabled by setting the environment variable `ENABLE_AUTOPAUSE` to "true".
|
||||
|
||||
|
||||
@@ -1,7 +1,13 @@
|
||||
|
||||
!!! tip "For advanced use only"
|
||||
|
||||
This page describes a capability that is not applicable to most users. It is only intended for rare cases when a very specific Java base image is needed or additional packages need to be installed that are not generally applicable or would bloat the image size.
|
||||
|
||||
Be sure to confirm that the desired [version and variant of Java isn't already provided](../versions/java.md).
|
||||
|
||||
## Building image locally with alternate Java base
|
||||
|
||||
The following shows how to change the base Java image used by the build:
|
||||
An alternate Java base image can be specified by setting the [docker build argument](https://docs.docker.com/reference/cli/docker/buildx/build/#build-arg) `BASE_IMAGE` to the desired base image. The following shows an example of using the base image `ghcr.io/graalvm/graalvm-ce:ol8-java11`:
|
||||
|
||||
```shell
|
||||
docker build --build-arg BASE_IMAGE=ghcr.io/graalvm/graalvm-ce:ol8-java11 -t IMG_PREFIX/minecraft-server:java11-graalvm .
|
||||
@@ -12,6 +12,8 @@
|
||||
Also, a specific version (or release type) can be declared adding a colon and then the version id, version number/name, or release type after the project slug. The version ID or number can be found in the 'Metadata' section. Valid release types are `release`, `beta`, `alpha`.
|
||||
|
||||
To select a datapack from a Modrinth project, prefix the entry with "datapack:". When running a vanilla server, this is optional since only datapacks will be available for vanilla servers to select.
|
||||
|
||||
You can also reference a file containing project entries by prefixing the **container path** path with `@`.
|
||||
|
||||
| Description | Example projects entry |
|
||||
|---------------------------------|-------------------------------------------------------|
|
||||
@@ -21,6 +23,43 @@
|
||||
| Latest version using project ID | `P7dR8mSH` |
|
||||
| Latest version of datapack | `datapack:terralith` |
|
||||
| Specific version of datapack | `datapack:terralith:2.5.5` |
|
||||
| Projects Listing File | `@/path/to/modrinth-mods.txt` |
|
||||
|
||||
!!! info "More about listing files"
|
||||
|
||||
Each line in the listing file is processed as one of the references above; however, blank lines and comments that start with `#` are ignored.
|
||||
|
||||
Make sure to place the listing file in a mounted directory/volume or declare an appropriate mount for it.
|
||||
|
||||
For example, `MODRINTH_PROJECTS` can be set to "@/extras/modrinth-mods.txt", assuming "/extras" has been added to `volumes` section, where the container file `/extras/modrinth-mods.txt` contains
|
||||
|
||||
```text
|
||||
# This comment is ignored
|
||||
fabric-api
|
||||
|
||||
# This and previous blank line are ignore
|
||||
cloth-config
|
||||
datapack:terralith
|
||||
```
|
||||
|
||||
## Version from Projects
|
||||
|
||||
When the environment variable `VERSION_FROM_MODRINTH_PROJECTS` is set to "true" the Minecraft [`VERSION`](../versions/minecraft.md) will be automatically determined by looking at the most recent version of Minecraft that is supported by all the projects provided in `MODRINTH_PROJECTS`.
|
||||
|
||||
!!! example
|
||||
|
||||
Given the environment variables
|
||||
|
||||
```yaml
|
||||
MODRINTH_PROJECTS: |
|
||||
viaversion
|
||||
viabackwards
|
||||
griefprevention
|
||||
discordsrv
|
||||
VERSION_FROM_MODRINTH_PROJECTS: true
|
||||
```
|
||||
|
||||
Let's say all are supported on Minecraft up to 1.21.8 except griefprevention, which is only supported up to 1.21.7. In that case, `VERSION` will be automatically set to 1.21.7.
|
||||
|
||||
## Extra options
|
||||
|
||||
@@ -30,3 +69,6 @@
|
||||
`MODRINTH_ALLOWED_VERSION_TYPE`
|
||||
: The version type is used to determine the newest version to use from each project. The allowed values are `release` (default), `beta`, `alpha`. Setting to `beta` will pick up both release and beta versions. Setting to `alpha` will pick up release, beta, and alpha versions.
|
||||
|
||||
`MODRINTH_LOADER`
|
||||
: When using a custom server, set this to specify which loader type will be requested during lookups
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
mkdocs-material == 9.6.14
|
||||
mkdocs-material == 9.6.16
|
||||
mkdocs-autorefs == 1.4.2
|
||||
mkdocstrings[python] == 0.29.1
|
||||
mkdocstrings[python] == 0.30.0
|
||||
mkdocs-literate-nav == 0.6.2
|
||||
mdx-gh-links == 0.4
|
||||
mkdocs-click == 0.9.0
|
||||
|
||||
@@ -41,21 +41,27 @@ A specific loader or launcher version other than the latest can be requested usi
|
||||
FABRIC_LOADER_VERSION: 0.13.1
|
||||
```
|
||||
|
||||
!!! note "Fabric API"
|
||||
!!! note
|
||||
|
||||
As [mentioned on the Fabric download page](https://fabricmc.net/use/installer/), most mods will require the Fabric API mod to be installed. That can be easily done by utilizing [the Modrinth downloads feature](../../mods-and-plugins/modrinth.md), such as adding this to the `environment` of a compose file service:
|
||||
|
||||
```yaml
|
||||
TYPE: FABRIC
|
||||
MODRINTH_PROJECTS: |
|
||||
fabric-api
|
||||
```
|
||||
See the [Working with mods and plugins](../../mods-and-plugins/index.md) section to set up Fabric mods and configuration.
|
||||
|
||||
!!! note "Alternate launcher"
|
||||
## Fabric API
|
||||
|
||||
If you wish to use an alternative launcher you can:
|
||||
As [mentioned on the Fabric download page](https://fabricmc.net/use/installer/), most mods will require the Fabric API mod to be installed. That can be easily done by utilizing [the Modrinth downloads feature](../../mods-and-plugins/modrinth.md), such as adding this to the `environment` of a compose file service:
|
||||
|
||||
- Provide the path to a custom launcher jar available to the container with `FABRIC_LAUNCHER`, relative to `/data` (such as `-e FABRIC_LAUNCHER=fabric-server-custom.jar`)
|
||||
- Provide the URL to a custom launcher jar with `FABRIC_LAUNCHER_URL` (such as `-e FABRIC_LAUNCHER_URL=http://HOST/fabric-server-custom.jar`)
|
||||
```yaml
|
||||
TYPE: FABRIC
|
||||
MODRINTH_PROJECTS: |
|
||||
fabric-api
|
||||
```
|
||||
|
||||
See the [Working with mods and plugins](../../mods-and-plugins/index.md) section to set up Fabric mods and configuration.
|
||||
## Alternate launcher
|
||||
|
||||
If you wish to use an alternative launcher you can:
|
||||
|
||||
- Provide the path to a custom launcher jar available to the container with `FABRIC_LAUNCHER`, relative to `/data` (such as `-e FABRIC_LAUNCHER=fabric-server-custom.jar`)
|
||||
- Provide the URL to a custom launcher jar with `FABRIC_LAUNCHER_URL` (such as `-e FABRIC_LAUNCHER_URL=http://HOST/fabric-server-custom.jar`)
|
||||
|
||||
## Force re-install
|
||||
|
||||
If the Fabric launcher jar becomes corrupted you can temporarily set FABRIC_FORCE_REINSTALL to "true" to have it re-installed on next startup.
|
||||
@@ -41,7 +41,9 @@ Configuration options with defaults:
|
||||
|
||||
## NanoLimbo
|
||||
|
||||
A [NanoLimbo](https://github.com/Nan1t/NanoLimbo) server can be run by setting `TYPE` to `NANOLIMBO`.
|
||||
A [NanoLimbo](https://github.com/BoomEaro/NanoLimbo) server can be run by setting `TYPE` to `NANOLIMBO`.
|
||||
|
||||
Note: it is a fork of the original [NanoLimbo](https://github.com/Nan1t/NanoLimbo) made by Nan1t
|
||||
|
||||
An alternate Limbo server
|
||||
|
||||
|
||||
@@ -126,3 +126,7 @@ If you have attached a host directory to the `/data` volume, then you can instal
|
||||
|
||||
!!! note
|
||||
The Folia type inherits from the Paper type. Paper's variables will override the Folia ones.
|
||||
|
||||
## Extra config
|
||||
|
||||
- `SKIP_DOWNLOAD_DEFAULTS`: when set to "true" startup will entirely skip checking for default Paper/Bukkit/Spigot config files to download
|
||||
@@ -10,29 +10,29 @@ or explicitly include the tag, such as
|
||||
|
||||
where `<tag>` refers to the first column of this table:
|
||||
|
||||
| Tag | Java version | Linux | JVM Type | Architecture | Note |
|
||||
|------------------|--------------|--------|--------------------|---------------------|------|
|
||||
| latest | 21 | Ubuntu | Hotspot | amd64, arm64 | |
|
||||
| stable | 21 | Ubuntu | Hotspot | amd64, arm64 | |
|
||||
| java24 | 24 | Ubuntu | Hotspot | amd64, arm64 | (2) |
|
||||
| java24-graalvm | 24 | Oracle | Oracle GraalVM (3) | amd64, arm64 | (2) |
|
||||
| java21 | 21 | Ubuntu | Hotspot | amd64, arm64 | |
|
||||
| java21-jdk | 21 | Ubuntu | Hotspot+JDK | amd64, arm64 | |
|
||||
| java21-alpine | 21 | Alpine | Hotspot | amd64, arm64 | |
|
||||
| java21-graalvm | 21 | Oracle | Oracle GraalVM (3) | amd64, arm64 | |
|
||||
| java17 | 17 | Ubuntu | Hotspot | amd64, arm64, armv7 | |
|
||||
| java17-graalvm | 17 | Oracle | Oracle GraalVM (3) | amd64, arm64 | |
|
||||
| java17-alpine | 17 | Alpine | Hotspot | amd64 (1) | |
|
||||
| java8 | 8 | Ubuntu | Hotspot | amd64, arm64, armv7 | |
|
||||
| java8-jdk | 8 | Ubuntu | Hotspot+JDK | amd64 | |
|
||||
| java8-openj9 | 8 | Debian | OpenJ9 | amd64 | |
|
||||
| java8-graalvm-ce | 8 | Oracle | GraalVM CE | amd64 | |
|
||||
| Tag | Java version | Linux | JVM Type | Architecture | Note |
|
||||
|----------------|--------------|--------|--------------------|---------------------|------|
|
||||
| latest | 21 | Ubuntu | Hotspot | amd64, arm64 | |
|
||||
| stable | 21 | Ubuntu | Hotspot | amd64, arm64 | |
|
||||
| java24 | 24 | Ubuntu | Hotspot | amd64, arm64 | (2) |
|
||||
| java24-graalvm | 24 | Oracle | Oracle GraalVM (3) | amd64, arm64 | (2) |
|
||||
| java21 | 21 | Ubuntu | Hotspot | amd64, arm64 | |
|
||||
| java21-jdk | 21 | Ubuntu | Hotspot+JDK | amd64, arm64 | |
|
||||
| java21-alpine | 21 | Alpine | Hotspot | amd64, arm64 | |
|
||||
| java21-graalvm | 21 | Oracle | Oracle GraalVM (3) | amd64, arm64 | |
|
||||
| java17 | 17 | Ubuntu | Hotspot | amd64, arm64, armv7 | |
|
||||
| java17-graalvm | 17 | Oracle | Oracle GraalVM (3) | amd64, arm64 | |
|
||||
| java17-alpine | 17 | Alpine | Hotspot | amd64 (1) | |
|
||||
| java16 | 16 | Ubuntu | Hotspot | amd64, arm64, armv7 | (4) |
|
||||
| java11 | 11 | Ubuntu | Hotspot | amd64, arm64, armv7 | |
|
||||
| java8 | 8 | Ubuntu | Hotspot | amd64, arm64, armv7 | |
|
||||
|
||||
Notes
|
||||
|
||||
1. Why no arm64 for Java 17 Alpine? That is because the base images, such as [elipse-temurin](https://hub.docker.com/_/eclipse-temurin/tags?page=&page_size=&ordering=&name=17-jre-alpine) do not provide support for that. Use the Ubuntu based images instead.
|
||||
2. Short-term variant, subject to deprecation upon next version introduction
|
||||
3. Based on the [Oracle GraalMV images](https://blogs.oracle.com/java/post/new-oracle-graalvm-container-images), which as of JDK 17, are now under the [GraalVM Free License](https://blogs.oracle.com/java/post/graalvm-free-license) incorporating what used to be known as the GraalVM Enterprise.
|
||||
4. This version of Java is [recommended for PaperMC 1.16.5](https://docs.papermc.io/paper/getting-started/#requirements)
|
||||
|
||||
!!! example "Example using java8"
|
||||
|
||||
@@ -131,12 +131,11 @@ The following image tags have been deprecated and are no longer receiving update
|
||||
- adopt15
|
||||
- openj9-nightly
|
||||
- multiarch-latest
|
||||
- java11
|
||||
- java16/java16-openj9
|
||||
- java16-openj9
|
||||
- java17-graalvm-ce
|
||||
- java17-openj9
|
||||
- java19
|
||||
- java20-graalvm, java20, java20-alpine
|
||||
- java23-*
|
||||
- java8-multiarch is still built and pushed, but please move to java8 instead
|
||||
- java8-alpine
|
||||
- java8-alpine, java8-jdk, java8-openj9, java8-graalvm-ce
|
||||
|
||||
@@ -9,12 +9,10 @@ services:
|
||||
EULA: true
|
||||
ALLOW_FLIGHT: true
|
||||
MOD_PLATFORM: AUTO_CURSEFORGE
|
||||
# Allocate API key from https://console.curseforge.com/
|
||||
# and set in .env file making sure to double up dollar signs, such as
|
||||
# CF_API_KEY=$$2a$$10$$....
|
||||
# Refer to https://docker-minecraft-server.readthedocs.io/en/latest/types-and-platforms/mod-platforms/auto-curseforge/#api-key
|
||||
CF_API_KEY: ${CF_API_KEY}
|
||||
CF_SLUG: craftoria
|
||||
MOTD: |
|
||||
A %TYPE% server on %VERSION%
|
||||
running %MODPACK_NAME% %MODPACK_VERSION%
|
||||
MEMORY: 8G
|
||||
volumes:
|
||||
# Use managed volume by default, but can change to a relative path like
|
||||
|
||||
15
examples/modrinth/version-from-modrinth-projects/compose.yml
Normal file
15
examples/modrinth/version-from-modrinth-projects/compose.yml
Normal file
@@ -0,0 +1,15 @@
|
||||
services:
|
||||
mc:
|
||||
image: itzg/minecraft-server
|
||||
environment:
|
||||
EULA: true
|
||||
TYPE: paper
|
||||
MODRINTH_PROJECTS: |
|
||||
viaversion
|
||||
viabackwards
|
||||
griefprevention
|
||||
discordsrv
|
||||
VERSION_FROM_MODRINTH_PROJECTS: true
|
||||
SETUP_ONLY: true
|
||||
ports:
|
||||
- "25565:25565"
|
||||
16
examples/packwiz/compose.yml
Normal file
16
examples/packwiz/compose.yml
Normal file
@@ -0,0 +1,16 @@
|
||||
services:
|
||||
mc:
|
||||
image: itzg/minecraft-server
|
||||
tty: true
|
||||
stdin_open: true
|
||||
environment:
|
||||
EULA: true
|
||||
# Match loader from versions section of https://github.com/packwiz/packwiz-example-pack/blob/v1/pack.toml
|
||||
TYPE: QUILT
|
||||
VERSION: "1.19"
|
||||
QUILT_LOADER_VERSION: "0.17.0"
|
||||
PACKWIZ_URL: https://raw.githubusercontent.com/packwiz/packwiz-example-pack/refs/heads/v1/pack.toml
|
||||
volumes:
|
||||
- ./data:/data
|
||||
ports:
|
||||
- "25565:25565"
|
||||
@@ -18,6 +18,7 @@
|
||||
"better-tips-nbt-tag",
|
||||
"betterf3",
|
||||
"betterfps",
|
||||
"bettergrassify",
|
||||
"biomeinfo",
|
||||
"block-drops-jei-addon",
|
||||
"blur-forge",
|
||||
@@ -27,6 +28,7 @@
|
||||
"chunk-animator",
|
||||
"clickable-advancements",
|
||||
"compass-coords",
|
||||
"config-menus-forge",
|
||||
"configured",
|
||||
"controllable",
|
||||
"controlling",
|
||||
@@ -36,6 +38,7 @@
|
||||
"dark-mode-everywhere",
|
||||
"defensive-measures",
|
||||
"ding",
|
||||
"distraction-free-recipes",
|
||||
"drippy-loading-screen",
|
||||
"dynamic-surroundings",
|
||||
"dynamic-view",
|
||||
@@ -62,6 +65,8 @@
|
||||
"fancymenu",
|
||||
"farsight",
|
||||
"faster-ladder-climbing",
|
||||
"fastquit",
|
||||
"fastquit-forge",
|
||||
"flerovium",
|
||||
"foamfix-optimization-mod",
|
||||
"forgeskyboxes",
|
||||
@@ -107,6 +112,8 @@
|
||||
"overloaded-armor-bar",
|
||||
"packmenu",
|
||||
"packmodemenu",
|
||||
"particle-effects",
|
||||
"particle-effects-reforged",
|
||||
"particular",
|
||||
"particular-reforged",
|
||||
"reauth",
|
||||
@@ -152,6 +159,7 @@
|
||||
"waila-harvestability",
|
||||
"wakes-reforged",
|
||||
"wawla",
|
||||
"welcome-screen",
|
||||
"xaeroplus",
|
||||
"yungs-menu-tweaks",
|
||||
"zume"
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
"axolotlbuckets",
|
||||
"BadOptimizations",
|
||||
"BetterAdvancements",
|
||||
"BetterGrassify",
|
||||
"betterbeds",
|
||||
"BetterThirdPerson",
|
||||
"BHMenu",
|
||||
@@ -25,9 +26,11 @@
|
||||
"compass-coords",
|
||||
"connectedness",
|
||||
"connector",
|
||||
"continuity",
|
||||
"craftpresence",
|
||||
"cwb",
|
||||
"DisableCustomWorldsAdvice",
|
||||
"distraction_free_recipes",
|
||||
"drippyloadingscreen",
|
||||
"eating-animation",
|
||||
"emiffect",
|
||||
@@ -39,9 +42,11 @@
|
||||
"fallingleaves",
|
||||
"fancymenu",
|
||||
"fast-ip-ping",
|
||||
"fastquit",
|
||||
"FauxCustomEntityData",
|
||||
"feytweaks",
|
||||
"figura",
|
||||
"ForgeConfigScreens",
|
||||
"GeckoLibIrisCompat",
|
||||
"gpumemleakfix",
|
||||
"Highlighter",
|
||||
@@ -79,6 +84,7 @@
|
||||
"sorted_enchantments",
|
||||
"visuality",
|
||||
"VR-Combat",
|
||||
"welcomescreen",
|
||||
"YeetusExperimentus",
|
||||
"yungsmenutweaks",
|
||||
"Zoomify",
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
{
|
||||
"accepts-transfers": {"env": "ACCEPTS_TRANSFERS"},
|
||||
"allow-flight": {"env": "ALLOW_FLIGHT"},
|
||||
"allow-nether": {"env": "ALLOW_NETHER"},
|
||||
"bug-report-link": {"env": "BUG_REPORT_LINK"},
|
||||
"announce-player-achievements": {"env": "ANNOUNCE_PLAYER_ACHIEVEMENTS"},
|
||||
"broadcast-console-to-ops": {"env": "BROADCAST_CONSOLE_TO_OPS"},
|
||||
"broadcast-rcon-to-ops": {"env": "BROADCAST_RCON_TO_OPS"},
|
||||
"bug-report-link": {"env": "BUG_REPORT_LINK"},
|
||||
"difficulty": {"env": "DIFFICULTY"},
|
||||
"enable-command-block": {"env": "ENABLE_COMMAND_BLOCK"},
|
||||
"enable-jmx-monitoring": {"env": "ENABLE_JMX"},
|
||||
@@ -42,14 +43,15 @@
|
||||
"previews-chat": {"env": "PREVIEWS_CHAT"},
|
||||
"pvp": {"env": "PVP"},
|
||||
"query.port": {"env": "QUERY_PORT"},
|
||||
"rate-limit": {"env": "RATE_LIMIT"},
|
||||
"rcon.password": {"env": "RCON_PASSWORD"},
|
||||
"rcon.port": {"env": "RCON_PORT"},
|
||||
"region-file-compression": {"env": "REGION_FILE_COMPRESSION"},
|
||||
"resource-pack": {"env": "RESOURCE_PACK"},
|
||||
"require-resource-pack": {"env": "RESOURCE_PACK_ENFORCE"},
|
||||
"resource-pack-id": {"env": "RESOURCE_PACK_ID"},
|
||||
"resource-pack-prompt": {"env": "RESOURCE_PACK_PROMPT"},
|
||||
"resource-pack-sha1": {"env": "RESOURCE_PACK_SHA1"},
|
||||
"require-resource-pack": {"env": "RESOURCE_PACK_ENFORCE"},
|
||||
"resource-pack": {"env": "RESOURCE_PACK"},
|
||||
"server-ip": {"env": "SERVER_IP"},
|
||||
"server-name": {"env": "SERVER_NAME"},
|
||||
"server-port": {"env": "SERVER_PORT"},
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 68 KiB After Width: | Height: | Size: 48 KiB |
@@ -139,6 +139,15 @@ cd /data || exit 1
|
||||
export DECLARED_TYPE=${TYPE^^}
|
||||
export DECLARED_VERSION="$VERSION"
|
||||
|
||||
if isTrue "${VERSION_FROM_MODRINTH_PROJECTS:-}" && [[ ${MODRINTH_PROJECTS:-} ]]; then
|
||||
if ! VERSION=$(mc-image-helper version-from-modrinth-projects --projects "${MODRINTH_PROJECTS}"); then
|
||||
logError "failed to resolve version from MODRINTH_PROJECTS: ${MODRINTH_PROJECTS}"
|
||||
exit 1
|
||||
fi
|
||||
log "Resolved Minecraft version $VERSION from Modrinth projects"
|
||||
export VERSION
|
||||
fi
|
||||
|
||||
if isTrue "${ENABLE_AUTOPAUSE}"; then
|
||||
"${SCRIPTS:-/}start-autopause"
|
||||
fi
|
||||
|
||||
@@ -70,38 +70,19 @@ function downloadSpigot {
|
||||
esac
|
||||
|
||||
if [[ ${VERSION^^} = LATEST ]]; then
|
||||
if ! VERSION=$(restify ${getBukkitSpigotUrl} --attribute='property=og:title' | jq -r '.[0] | .attributes | select(.property == "og:title") | .content | split(" ") | .[-1]'); then
|
||||
if ! downloadUrl=$(restify "${getBukkitBaseUrl}/${getbukkitFlavor}" --id='downloadr' | jq -r '.[0] | .href '); then
|
||||
logError "Failed to retrieve latest version from ${getBukkitSpigotUrl} -- site might be down"
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
if [[ -z $downloadUrl ]]; then
|
||||
downloadBaseUrl="https://"
|
||||
downloadSuffixUrl=".getbukkit.org/${getbukkitFlavor}/${getbukkitFlavor}-${VERSION}.jar"
|
||||
if versionLessThan 1.16.5 || { [[ ${getbukkitFlavor} = "craftbukkit" ]] && [[ ${VERSION} = "1.16.5" ]] ; }; then
|
||||
downloadBaseUrl+="cdn"
|
||||
else
|
||||
downloadBaseUrl+="download"
|
||||
fi
|
||||
downloadUrl="${downloadBaseUrl}${downloadSuffixUrl}"
|
||||
downloadUrl="https://cdn.getbukkit.org/${getbukkitFlavor}/${getbukkitFlavor}-${VERSION}.jar"
|
||||
fi
|
||||
|
||||
setServerVar
|
||||
curlArgs=()
|
||||
if [ -f "$SERVER" ] && ! isTrue "$FORCE_REDOWNLOAD"; then
|
||||
# tell curl to only download when newer
|
||||
curlArgs+=(-z "$SERVER")
|
||||
fi
|
||||
if isDebugging; then
|
||||
curlArgs+=(-v)
|
||||
fi
|
||||
log "Downloading $match from $downloadUrl ..."
|
||||
log "Downloading $match from $downloadUrl if missing ..."
|
||||
|
||||
tempFile="$SERVER.$$"
|
||||
|
||||
# HTTP error or download site responded with an HTML error page
|
||||
if ! curl -fsSL -o "$tempFile" "${curlArgs[@]}" "$downloadUrl" || ( [ -f "$tempFile" ] && grep -iq "doctype html" "$tempFile" ); then
|
||||
if ! SERVER=$(get -o /data --skip-existing --output-filename "$downloadUrl"); then
|
||||
|
||||
cat <<EOF
|
||||
|
||||
@@ -111,29 +92,9 @@ ERROR: failed to download from $downloadUrl
|
||||
Click into the version entry to find the **exact** version.
|
||||
|
||||
EOF
|
||||
|
||||
if isDebugging && grep -iq "doctype html" "$tempFile"; then
|
||||
cat "$tempFile"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ -f "$SERVER" ]; then
|
||||
log "Continuing with existing $SERVER file"
|
||||
else
|
||||
# remove invalid download
|
||||
rm "$tempFile"
|
||||
exit 3
|
||||
fi
|
||||
|
||||
else
|
||||
if [ -f "$tempFile" ]; then
|
||||
mv "$tempFile" "$SERVER"
|
||||
fi
|
||||
|
||||
fi
|
||||
|
||||
|
||||
JVM_OPTS="${JVM_OPTS} -DIReallyKnowWhatIAmDoingISwear"
|
||||
export JVM_OPTS
|
||||
export SERVER
|
||||
}
|
||||
|
||||
function setServerVar {
|
||||
@@ -157,6 +118,8 @@ else
|
||||
downloadSpigot
|
||||
fi
|
||||
|
||||
JVM_OPTS="${JVM_OPTS} -DIReallyKnowWhatIAmDoingISwear"
|
||||
export JVM_OPTS
|
||||
# Normalize on Spigot for operations below
|
||||
export FAMILY=SPIGOT
|
||||
|
||||
|
||||
@@ -9,15 +9,24 @@ export TYPE=FABRIC
|
||||
: "${FABRIC_LAUNCHER:=}"
|
||||
: "${FABRIC_LAUNCHER_URL:=}"
|
||||
: "${FABRIC_LOADER_VERSION:=LATEST}"
|
||||
: "${FABRIC_FORCE_REINSTALL:=false}"
|
||||
|
||||
resultsFile=/data/.install-fabric.env
|
||||
|
||||
isDebugging && set -x
|
||||
|
||||
commonArgs=(
|
||||
--results-file="${resultsFile}"
|
||||
)
|
||||
if isTrue "${FABRIC_FORCE_REINSTALL}"; then
|
||||
log "Forcing re-install of Fabric"
|
||||
commonArgs+=(--force-reinstall)
|
||||
fi
|
||||
|
||||
# Custom fabric jar
|
||||
if [[ $FABRIC_LAUNCHER ]]; then
|
||||
if ! mc-image-helper install-fabric-loader \
|
||||
--results-file=${resultsFile} \
|
||||
"${commonArgs[@]}" \
|
||||
--from-local-file="$FABRIC_LAUNCHER"; then
|
||||
logError "Failed to use provided Fabric launcher"
|
||||
exit 1
|
||||
@@ -26,7 +35,7 @@ if [[ $FABRIC_LAUNCHER ]]; then
|
||||
# Custom fabric jar url
|
||||
elif [[ $FABRIC_LAUNCHER_URL ]]; then
|
||||
if ! mc-image-helper install-fabric-loader \
|
||||
--results-file=${resultsFile} \
|
||||
"${commonArgs[@]}" \
|
||||
--from-url="$FABRIC_LAUNCHER_URL"; then
|
||||
logError "Failed to installFabric launcher from $FABRIC_LAUNCHER_URL"
|
||||
exit 1
|
||||
@@ -35,7 +44,7 @@ elif [[ $FABRIC_LAUNCHER_URL ]]; then
|
||||
# Official fabric launcher
|
||||
else
|
||||
if ! mc-image-helper install-fabric-loader \
|
||||
--results-file=${resultsFile} \
|
||||
"${commonArgs[@]}" \
|
||||
--minecraft-version="${VERSION}" \
|
||||
--installer-version="${FABRIC_LAUNCHER_VERSION}" \
|
||||
--loader-version="${FABRIC_LOADER_VERSION}"; then
|
||||
|
||||
@@ -7,7 +7,7 @@ isDebugging && set -x
|
||||
if ! SERVER=$(mc-image-helper github download-latest-asset \
|
||||
--output-directory=/data \
|
||||
--name-pattern="NanoLimbo-.+?(?<!-sources)\.jar" \
|
||||
Nan1t/NanoLimbo
|
||||
BoomEaro/NanoLimbo
|
||||
); then
|
||||
logError "Failed to download NanoLimbo"
|
||||
exit 1
|
||||
|
||||
@@ -10,7 +10,7 @@ handleDebugMode
|
||||
: "${PAPER_CHANNEL:=default}"
|
||||
: "${PAPER_DOWNLOAD_URL:=}"
|
||||
: "${PAPER_CUSTOM_JAR:=}"
|
||||
: "${PAPER_CONFIG_DEFAULTS_REPO:=${PAPER_CONFIG_REPO:=https://raw.githubusercontent.com/dayyeeet/minecraft-default-configs/main}}"
|
||||
: "${PAPER_CONFIG_DEFAULTS_REPO:=${PAPER_CONFIG_REPO:=https://raw.githubusercontent.com/Shonz1/minecraft-default-configs/main}}"
|
||||
|
||||
resultsFile=/data/.paper.env
|
||||
if [[ $PAPER_CUSTOM_JAR ]]; then
|
||||
|
||||
@@ -21,7 +21,9 @@ PUFFERFISH_BUILD_JSON=$(curl -X GET -s "https://ci.pufferfish.host/job/Pufferfis
|
||||
PUFFERFISH_BUILD_URL=$(jq -n "$PUFFERFISH_BUILD_JSON" | jq -jc '.url // empty' )
|
||||
# Example: "fileName": "pufferfish-paperclip-1.18.2-R0.1-SNAPSHOT-reobf.jar",
|
||||
PUFFERFISH_BUILD_FILENAME=$(jq -n "$PUFFERFISH_BUILD_JSON" | jq -jc '.artifacts[].fileName // empty' )
|
||||
PUFFERFISH_BUILD_DOWNLOAD_URL="${PUFFERFISH_BUILD_URL}artifact/build/libs/${PUFFERFISH_BUILD_FILENAME}"
|
||||
# Example: "relativePath": "pufferfish-server/build/libs/pufferfish-paperclip-1.21.7-R0.1-SNAPSHOT-mojmap.jar",
|
||||
PUFFERFISH_BUILD_PATH=$(jq -n "$PUFFERFISH_BUILD_JSON" | jq -jc '.artifacts[].relativePath // empty' )
|
||||
PUFFERFISH_BUILD_DOWNLOAD_URL="${PUFFERFISH_BUILD_URL}artifact/${PUFFERFISH_BUILD_PATH}"
|
||||
|
||||
# Setting server to the Jar filename for export.
|
||||
export SERVER=$PUFFERFISH_BUILD_FILENAME
|
||||
|
||||
@@ -14,7 +14,9 @@ handleDebugMode
|
||||
: "${REPLACE_ENV_VARIABLES_EXCLUDE_PATHS:=}"
|
||||
: "${PATCH_DEFINITIONS:=}"
|
||||
: "${DEBUG:=false}"
|
||||
: "${DOWNLOAD_DEFAULTS:=}"
|
||||
: "${DOWNLOAD_DEFAULT_CONFIGS:=}"
|
||||
: "${SKIP_DOWNLOAD_DEFAULTS:=false}"
|
||||
|
||||
if isTrue "${REPLACE_ENV_IN_PLACE}"; then
|
||||
log "Replacing env variables in ${REPLACE_ENV_PATHS} that match the prefix '$REPLACE_ENV_VARIABLE_PREFIX' ..."
|
||||
@@ -27,22 +29,28 @@ if isTrue "${REPLACE_ENV_IN_PLACE}"; then
|
||||
"${REPLACE_ENV_PATHS[@]}"
|
||||
fi
|
||||
|
||||
if [[ $DOWNLOAD_DEFAULT_CONFIGS ]]; then
|
||||
log "Downloading default configs, if needed"
|
||||
if ! mc-image-helper mcopy \
|
||||
--to /data/config \
|
||||
--skip-existing --skip-up-to-date=false \
|
||||
"$DOWNLOAD_DEFAULT_CONFIGS" 2> /dev/null; then
|
||||
logWarning "One or more default config files were not available from $DOWNLOAD_DEFAULT_CONFIGS"
|
||||
if isFalse "$SKIP_DOWNLOAD_DEFAULTS"; then
|
||||
commonArgs=(
|
||||
--skip-existing
|
||||
--skip-up-to-date=false
|
||||
--quiet-when-skipped
|
||||
--ignore-missing-sources
|
||||
)
|
||||
if [[ $DOWNLOAD_DEFAULT_CONFIGS ]]; then
|
||||
if ! mc-image-helper mcopy \
|
||||
--to /data/config \
|
||||
"${commonArgs[@]}" \
|
||||
"$DOWNLOAD_DEFAULT_CONFIGS"; then
|
||||
logWarning "One or more default config files were not available from $DOWNLOAD_DEFAULT_CONFIGS"
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
if [[ $DOWNLOAD_DEFAULTS ]]; then
|
||||
log "Downloading default top-level configs, if needed"
|
||||
if ! mc-image-helper mcopy \
|
||||
--to /data \
|
||||
--skip-existing --skip-up-to-date=false \
|
||||
"$DOWNLOAD_DEFAULTS" 2> /dev/null; then
|
||||
logWarning "One or more default files were not available from $DOWNLOAD_DEFAULTS"
|
||||
if [[ $DOWNLOAD_DEFAULTS ]]; then
|
||||
if ! mc-image-helper mcopy \
|
||||
--to /data \
|
||||
"${commonArgs[@]}" \
|
||||
"$DOWNLOAD_DEFAULTS"; then
|
||||
logWarning "One or more default files were not available from $DOWNLOAD_DEFAULTS"
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
|
||||
@@ -12,6 +12,7 @@ set -e -o pipefail
|
||||
: "${REMOVE_OLD_MODS_DEPTH:=1} "
|
||||
: "${REMOVE_OLD_MODS_INCLUDE:=*.jar,*-version.json}"
|
||||
: "${CF_API_KEY_FILE:=}" # Path to file containing CurseForge API key
|
||||
: "${MODRINTH_LOADER:=}"
|
||||
sum_file=/data/.generic_pack.sum
|
||||
|
||||
if [[ -n ${CF_API_KEY_FILE} ]]; then
|
||||
@@ -263,13 +264,21 @@ function handleModrinthProjects() {
|
||||
fi
|
||||
|
||||
if [[ $MODRINTH_PROJECTS ]]; then
|
||||
if isFamily HYBRID; then
|
||||
|
||||
if isType CUSTOM; then
|
||||
if ! [[ $MODRINTH_LOADER ]]; then
|
||||
logError "MODRINTH_LOADER must be set when using TYPE=CUSTOM and MODRINTH_PROJECTS"
|
||||
exit 1
|
||||
fi
|
||||
loader="${MODRINTH_LOADER,,}"
|
||||
elif isFamily HYBRID; then
|
||||
loader=${HYBRIDTYPE}
|
||||
elif isFamily VANILLA; then
|
||||
loader=datapack
|
||||
else
|
||||
loader="${TYPE,,}"
|
||||
fi
|
||||
|
||||
mc-image-helper modrinth \
|
||||
--output-directory=/data \
|
||||
--world-directory="${LEVEL:-world}" \
|
||||
|
||||
@@ -411,7 +411,7 @@ function isFamily() {
|
||||
function isType() {
|
||||
for t in "${@}"; do
|
||||
# shellcheck disable=SC2153
|
||||
if [[ $TYPE == "$t" ]]; then
|
||||
if [[ ${TYPE^^} == "${t^^}" ]]; then
|
||||
return 0
|
||||
fi
|
||||
done
|
||||
|
||||
9
tests/setuponlytests/nanolimbo/docker-compose.yml
Normal file
9
tests/setuponlytests/nanolimbo/docker-compose.yml
Normal file
@@ -0,0 +1,9 @@
|
||||
services:
|
||||
mc:
|
||||
restart: "no"
|
||||
image: ${IMAGE_TO_TEST:-itzg/minecraft-server}
|
||||
environment:
|
||||
EULA: "TRUE"
|
||||
TYPE: NANOLIMBO
|
||||
volumes:
|
||||
- ./data:/data
|
||||
1
tests/setuponlytests/nanolimbo/verify.sh
Normal file
1
tests/setuponlytests/nanolimbo/verify.sh
Normal file
@@ -0,0 +1 @@
|
||||
mc-image-helper assert fileExists "/data/NanoLimbo-*.jar"
|
||||
Reference in New Issue
Block a user