mirror of
https://github.com/itzg/docker-minecraft-server.git
synced 2026-02-17 23:16:24 +00:00
Compare commits
36 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
99f31d5a9b | ||
|
|
155b478ee1 | ||
|
|
6faa3a379d | ||
|
|
fc6fcb68e5 | ||
|
|
0da12d1518 | ||
|
|
a9b4e67d22 | ||
|
|
75016e948b | ||
|
|
d72db19b4e | ||
|
|
cad2bc1ef6 | ||
|
|
c29430ffc5 | ||
|
|
7c05109ffa | ||
|
|
ce0f1599de | ||
|
|
57a3fe7641 | ||
|
|
75082daa1d | ||
|
|
b1d68a65aa | ||
|
|
11414c83c1 | ||
|
|
720006b445 | ||
|
|
9d2cd1475e | ||
|
|
acfd6fadf8 | ||
|
|
ba172b2aa9 | ||
|
|
e4859fb23a | ||
|
|
eb682118ff | ||
|
|
2fbc804f3e | ||
|
|
5bd6287f52 | ||
|
|
b6a8b95159 | ||
|
|
0d834dd992 | ||
|
|
0a5ac8aba6 | ||
|
|
37d2aebb1e | ||
|
|
d5d1592c38 | ||
|
|
dedacfb94e | ||
|
|
c6e970c8d2 | ||
|
|
fa56741869 | ||
|
|
2abae7462c | ||
|
|
a569d63cf3 | ||
|
|
e305782a8f | ||
|
|
24c352949c |
9
.github/workflows/build-multiarch.yml
vendored
9
.github/workflows/build-multiarch.yml
vendored
@@ -12,6 +12,7 @@ on:
|
||||
- "examples/**"
|
||||
- "notes/**"
|
||||
- "kustomize/**"
|
||||
- "images.json"
|
||||
|
||||
jobs:
|
||||
build:
|
||||
@@ -118,14 +119,14 @@ jobs:
|
||||
runs-on: ubuntu-22.04
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4.2.2
|
||||
uses: actions/checkout@v5.0.0
|
||||
with:
|
||||
# for build-files step
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Docker meta
|
||||
id: meta
|
||||
uses: docker/metadata-action@v5.7.0
|
||||
uses: docker/metadata-action@v5.8.0
|
||||
with:
|
||||
# NOTE for forks: if your Docker Hub organization doesn't match your Github repo's,
|
||||
# then the use of ${{ github.repository_owner }} will need to be replaced.
|
||||
@@ -185,14 +186,14 @@ jobs:
|
||||
tests/test.sh
|
||||
|
||||
- name: Login to DockerHub
|
||||
uses: docker/login-action@v3.4.0
|
||||
uses: docker/login-action@v3.5.0
|
||||
if: env.HAS_IMAGE_REPO_ACCESS
|
||||
with:
|
||||
username: ${{ secrets.DOCKER_USER }}
|
||||
password: ${{ secrets.DOCKER_PASSWORD }}
|
||||
|
||||
- name: Login to GHCR
|
||||
uses: docker/login-action@v3.4.0
|
||||
uses: docker/login-action@v3.5.0
|
||||
if: env.HAS_IMAGE_REPO_ACCESS
|
||||
with:
|
||||
registry: ghcr.io
|
||||
|
||||
3
.github/workflows/verify-pr.yml
vendored
3
.github/workflows/verify-pr.yml
vendored
@@ -11,6 +11,7 @@ on:
|
||||
- "kustomize/**"
|
||||
- "docker-compose*.yml"
|
||||
- "mkdocs.yml"
|
||||
- "images.json"
|
||||
|
||||
jobs:
|
||||
build:
|
||||
@@ -49,7 +50,7 @@ jobs:
|
||||
runs-on: ubuntu-22.04
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4.2.2
|
||||
uses: actions/checkout@v5.0.0
|
||||
with:
|
||||
# for build-files step
|
||||
fetch-depth: 0
|
||||
|
||||
@@ -43,12 +43,12 @@ 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.13.1
|
||||
ARG MC_SERVER_RUNNER_VERSION=1.13.3
|
||||
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.48.1
|
||||
ARG MC_HELPER_VERSION=1.48.11
|
||||
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
|
||||
@@ -65,8 +65,7 @@ STOPSIGNAL SIGTERM
|
||||
ENV TYPE=VANILLA VERSION=LATEST EULA="" UID=1000 GID=1000 LC_ALL=en_US.UTF-8
|
||||
|
||||
COPY --chmod=755 scripts/start* /
|
||||
COPY --chmod=755 bin/ /usr/local/bin/
|
||||
COPY --chmod=755 bin/mc-health /health.sh
|
||||
COPY --chmod=755 files/shims/ /usr/local/bin/
|
||||
COPY --chmod=755 files/* /image/
|
||||
COPY --chmod=755 files/auto /auto
|
||||
|
||||
|
||||
@@ -1,143 +1,139 @@
|
||||
# JVM Options
|
||||
|
||||
## Memory Limit
|
||||
|
||||
By default, the image declares an initial and maximum Java memory-heap limit of 1 GB. There are several ways to adjust the memory settings:
|
||||
|
||||
- `MEMORY`: "1G" by default, can be used to adjust both initial (`Xms`) and max (`Xmx`) memory heap settings of the JVM
|
||||
- `INIT_MEMORY`: independently sets the initial heap size
|
||||
- `MAX_MEMORY`: independently sets the max heap size
|
||||
|
||||
The values of all three are passed directly to the JVM and support format/units as `<size>[g|G|m|M|k|K]`.
|
||||
|
||||
!!! example "Using docker run"
|
||||
|
||||
```
|
||||
-e MEMORY=2G
|
||||
```
|
||||
|
||||
or to use init and max memory:
|
||||
|
||||
```
|
||||
-e INIT_MEMORY=1G -e MAX_MEMORY=4G
|
||||
```
|
||||
|
||||
!!! example "Using compose file"
|
||||
|
||||
```
|
||||
environment:
|
||||
MEMORY: 2G
|
||||
```
|
||||
|
||||
or to use init and max memory:
|
||||
|
||||
```
|
||||
environment:
|
||||
INIT_MEMORY: 1G
|
||||
MAX_MEMORY: 4G
|
||||
```
|
||||
|
||||
To let the JVM calculate the heap size from the container declared memory limit, unset `MEMORY` with an empty value, such as `-e MEMORY=""`. By default, the JVM will use 25% of the container memory limit as the heap limit; however, as an example the following would tell the JVM to use 75% of the container limit of 4GB of memory:
|
||||
|
||||
!!! example "MaxRAMPercentage using compose file"
|
||||
|
||||
```
|
||||
environment:
|
||||
MEMORY: ""
|
||||
JVM_XX_OPTS: "-XX:MaxRAMPercentage=75"
|
||||
deploy:
|
||||
resources:
|
||||
limits:
|
||||
memory: 4G
|
||||
```
|
||||
|
||||
!!! important
|
||||
The settings above only set the Java **heap** limits. Memory resource requests and limits on the overall container should also account for non-heap memory usage. An extra 25% is [a general best practice](https://dzone.com/articles/best-practices-java-memory-arguments-for-container).
|
||||
|
||||
## Extra JVM Options
|
||||
|
||||
General 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.
|
||||
|
||||
```
|
||||
docker run ... -e JVM_OPTS="-someJVMOption someJVMOptionValue" ...
|
||||
```
|
||||
|
||||
**NOTE** When declaring `JVM_OPTS` in a compose file's `environment` section with list syntax, **do not** include the quotes:
|
||||
|
||||
```yaml
|
||||
environment:
|
||||
- EULA=true
|
||||
- JVM_OPTS=-someJVMOption someJVMOptionValue
|
||||
```
|
||||
|
||||
Using object syntax is recommended and more intuitive:
|
||||
|
||||
```yaml
|
||||
environment:
|
||||
EULA: "true"
|
||||
JVM_OPTS: "-someJVMOption someJVMOptionValue"
|
||||
# or
|
||||
# JVM_OPTS: -someJVMOption someJVMOptionValue
|
||||
```
|
||||
|
||||
As 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.)
|
||||
|
||||
For example, instead of passing
|
||||
|
||||
```yaml
|
||||
JVM_OPTS: -Dfml.queryResult=confirm -Dname=value
|
||||
```
|
||||
|
||||
you can use
|
||||
|
||||
```yaml
|
||||
JVM_DD_OPTS: fml.queryResult=confirm,name=value
|
||||
```
|
||||
|
||||
## Enable Remote JMX for Profiling
|
||||
|
||||
To enable remote JMX, such as for profiling with VisualVM or JMC, set the environment variable `ENABLE_JMX` to "true", set `JMX_HOST` to the IP/host running the Docker container, and add a port forwarding of TCP port 7091, such as:
|
||||
|
||||
!!! example
|
||||
|
||||
With `docker run`
|
||||
|
||||
```
|
||||
-e ENABLE_JMX=true -e JMX_HOST=$HOSTNAME -p 7091:7091
|
||||
```
|
||||
|
||||
If needing to map to a different port, then also set the environment variable `JMX_PORT` to the desired host port.
|
||||
|
||||
!!! example
|
||||
|
||||
With a compose file:
|
||||
|
||||
```yaml
|
||||
environment:
|
||||
ENABLE_JMX: true
|
||||
JMX_HOST: ${HOSTNAME}
|
||||
JMX_PORT: "7092"
|
||||
ports:
|
||||
- "7092:7092"
|
||||
```
|
||||
|
||||
## Enable Aikar's Flags
|
||||
|
||||
[Aikar has done some research](https://aikar.co/2018/07/02/tuning-the-jvm-g1gc-garbage-collector-flags-for-minecraft/) into finding the optimal JVM flags for GC tuning, which becomes more important as more users are connected concurrently. [PaperMC also has an explanation](https://docs.papermc.io/paper/aikars-flags) of what the JVM flags are doing.
|
||||
|
||||
The set of flags documented there can be added using
|
||||
|
||||
-e USE_AIKAR_FLAGS=true
|
||||
|
||||
When `MEMORY` is greater than or equal to 12G, then the Aikar flags will be adjusted according to the article.
|
||||
|
||||
## Enable MeowIce's Flags
|
||||
|
||||
[MeowIce has created an updated set of JVM flags](https://github.com/MeowIce/meowice-flags?tab=readme-ov-file#why-would-i-have-to-switch-) based on Aikar's flags but with support for optimizations for Java 17 and above
|
||||
|
||||
The set of flags documented there can be added using
|
||||
|
||||
-e USE_MEOWICE_FLAGS=true
|
||||
|
||||
There is an optional `USE_MEOWICE_GRAALVM_FLAGS` variable to enable GraalVM specific optimizations, defaults to `TRUE` if USE_MEOWICE_GRAALVM_FLAGS is `TRUE`
|
||||
# JVM Options
|
||||
|
||||
## Memory Limit
|
||||
|
||||
By default, the image declares an initial and maximum Java memory-heap limit of 1 GB. There are several ways to adjust the memory settings:
|
||||
|
||||
- `MEMORY`: "1G" by default, can be used to adjust both initial (`Xms`) and max (`Xmx`) memory heap settings of the JVM
|
||||
- `INIT_MEMORY`: independently sets the initial heap size
|
||||
- `MAX_MEMORY`: independently sets the max heap size
|
||||
|
||||
The values of all three are passed directly to the JVM and support format/units as `<size>[g|G|m|M|k|K]`.
|
||||
|
||||
!!! example "Using docker run"
|
||||
|
||||
```
|
||||
-e MEMORY=2G
|
||||
```
|
||||
|
||||
or to use init and max memory:
|
||||
|
||||
```
|
||||
-e INIT_MEMORY=1G -e MAX_MEMORY=4G
|
||||
```
|
||||
|
||||
!!! example "Using compose file"
|
||||
|
||||
```
|
||||
environment:
|
||||
MEMORY: 2G
|
||||
```
|
||||
|
||||
or to use init and max memory:
|
||||
|
||||
```
|
||||
environment:
|
||||
INIT_MEMORY: 1G
|
||||
MAX_MEMORY: 4G
|
||||
```
|
||||
|
||||
To let the JVM calculate the heap size from the container declared memory limit, unset `MEMORY` with an empty value, such as `-e MEMORY=""`. By default, the JVM will use 25% of the container memory limit as the heap limit; however, as an example the following would tell the JVM to use 75% of the container limit of 4GB of memory:
|
||||
|
||||
!!! example "MaxRAMPercentage using compose file"
|
||||
|
||||
```
|
||||
environment:
|
||||
MEMORY: ""
|
||||
JVM_XX_OPTS: "-XX:MaxRAMPercentage=75"
|
||||
deploy:
|
||||
resources:
|
||||
limits:
|
||||
memory: 4G
|
||||
```
|
||||
|
||||
!!! important
|
||||
The settings above only set the Java **heap** limits. Memory resource requests and limits on the overall container should also account for non-heap memory usage. An extra 25% is [a general best practice](https://dzone.com/articles/best-practices-java-memory-arguments-for-container).
|
||||
|
||||
## Extra JVM Options
|
||||
|
||||
General 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.
|
||||
|
||||
```
|
||||
docker run ... -e JVM_OPTS="-someJVMOption someJVMOptionValue" ...
|
||||
```
|
||||
|
||||
**NOTE** When declaring `JVM_OPTS` in a compose file's `environment` section with list syntax, **do not** include the quotes:
|
||||
|
||||
```yaml
|
||||
environment:
|
||||
- EULA=true
|
||||
- JVM_OPTS=-someJVMOption someJVMOptionValue
|
||||
```
|
||||
|
||||
Using object syntax is recommended and more intuitive:
|
||||
|
||||
```yaml
|
||||
environment:
|
||||
EULA: "true"
|
||||
JVM_OPTS: "-someJVMOption someJVMOptionValue"
|
||||
# or
|
||||
# JVM_OPTS: -someJVMOption someJVMOptionValue
|
||||
```
|
||||
|
||||
As 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.)
|
||||
|
||||
For example, instead of passing
|
||||
|
||||
```yaml
|
||||
JVM_OPTS: -Dfml.queryResult=confirm -Dname=value
|
||||
```
|
||||
|
||||
you can use
|
||||
|
||||
```yaml
|
||||
JVM_DD_OPTS: fml.queryResult=confirm,name=value
|
||||
```
|
||||
|
||||
## Enable Remote JMX for Profiling
|
||||
|
||||
To enable remote JMX, such as for profiling with VisualVM or JMC, set the environment variable `ENABLE_JMX` to "true", set `JMX_HOST` to the IP/host running the Docker container, and add a port forwarding of TCP port 7091, such as:
|
||||
|
||||
!!! example
|
||||
|
||||
With `docker run`
|
||||
|
||||
```
|
||||
-e ENABLE_JMX=true -e JMX_HOST=$HOSTNAME -p 7091:7091
|
||||
```
|
||||
|
||||
If needing to map to a different port, then also set the environment variable `JMX_PORT` to the desired host port.
|
||||
|
||||
!!! example
|
||||
|
||||
With a compose file:
|
||||
|
||||
```yaml
|
||||
environment:
|
||||
ENABLE_JMX: true
|
||||
JMX_HOST: ${HOSTNAME}
|
||||
JMX_PORT: "7092"
|
||||
ports:
|
||||
- "7092:7092"
|
||||
```
|
||||
|
||||
## Enable Aikar's Flags
|
||||
|
||||
[Aikar has done some research](https://aikar.co/2018/07/02/tuning-the-jvm-g1gc-garbage-collector-flags-for-minecraft/) into finding the optimal JVM flags for GC tuning, which becomes more important as more users are connected concurrently. [PaperMC also has an explanation](https://docs.papermc.io/paper/aikars-flags) of what the JVM flags are doing.
|
||||
|
||||
The set of flags documented there can be added using
|
||||
|
||||
-e USE_AIKAR_FLAGS=true
|
||||
|
||||
When `MEMORY` is greater than or equal to 12G, then the Aikar flags will be adjusted according to the article.
|
||||
|
||||
## Enable MeowIce's Flags
|
||||
|
||||
[MeowIce has created an updated set of JVM flags](https://github.com/MeowIce/meowice-flags?tab=readme-ov-file#why-would-i-have-to-switch-) based on Aikar's flags but with support for optimizations for Java 17 and above
|
||||
|
||||
The set of flags documented there can be added by setting the environment variable `USE_MEOWICE_FLAGS` to `true`. There is an optional `USE_MEOWICE_GRAALVM_FLAGS` variable to enable GraalVM specific optimizations, defaults to `FALSE`.
|
||||
|
||||
@@ -107,11 +107,7 @@ such as:
|
||||
|
||||
## HTTP Proxy
|
||||
|
||||
You may configure the use of an HTTP/HTTPS proxy by passing the proxy's URL via the `PROXY`
|
||||
environment variable. In [the example compose file](https://github.com/itzg/docker-minecraft-server/blob/master/examples/docker-compose-proxied.yml) it references
|
||||
a companion squid proxy by setting the equivalent of
|
||||
|
||||
-e PROXY=proxy:3128
|
||||
You may configure the use of an HTTP/HTTPS proxy by passing the proxy's "host:port" via the environment variable `PROXY`. In [the example compose file](https://github.com/itzg/docker-minecraft-server/blob/master/examples/docker-compose-proxied.yml) it references a Squid proxy. The host and port can be separately passed via the environment variables `PROXY_HOST` and `PROXY_PORT`. A `|` delimited list of hosts to exclude from proxying can be passed via `PROXY_NON_PROXY_HOSTS`.
|
||||
|
||||
## Using "noconsole" option
|
||||
|
||||
|
||||
@@ -414,6 +414,9 @@ When using `docker run` from a bash shell, the entries must be quoted with the `
|
||||
| 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) |
|
||||
| MANAGEMENT_SERVER_ENABLED | [management-server-enabled](https://minecraft.wiki/w/Server.properties#management-server-enabled) |
|
||||
| MANAGEMENT_SERVER_HOST | [management-server-host](https://minecraft.wiki/w/Server.properties#management-server-host) |
|
||||
| MANAGEMENT_SERVER_PORT | [management-server-port](https://minecraft.wiki/w/Server.properties#management-server-port) |
|
||||
| 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) |
|
||||
@@ -433,6 +436,7 @@ When using `docker run` from a bash shell, the entries must be quoted with the `
|
||||
| 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) |
|
||||
| STATUS_HEARTBEAT_INTERVAL | [status-heartbeat-interval](https://minecraft.wiki/w/Server.properties#status-heartbeat-interval) |
|
||||
| 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) |
|
||||
@@ -7,14 +7,14 @@ CONTAINER ID IMAGE COMMAND CREATED
|
||||
b418af073764 mc "/start" 43 seconds ago Up 41 seconds (healthy) 0.0.0.0:25565->25565/tcp, 25575/tcp mc
|
||||
```
|
||||
|
||||
You can also query the container's health in a script friendly way:
|
||||
You can also query the container's health in a script-friendly way:
|
||||
|
||||
``` shell
|
||||
> docker container inspect -f "{{.State.Health.Status}}" mc
|
||||
healthy
|
||||
```
|
||||
|
||||
There's actually a wrapper script called `mc-health` that takes care of calling `mc-monitor status` with the correct arguments. If needing to customize the health checks parameters, such as in a compose file, then use something like the following in the service declaration:
|
||||
There's actually a wrapper script called `mc-health` that takes care of calling `mc-monitor status` with the correct arguments. If needing to customize the health checks parameters, such as in a Compose file, then use something like the following in the service declaration:
|
||||
|
||||
``` yaml
|
||||
healthcheck:
|
||||
@@ -24,9 +24,16 @@ healthcheck:
|
||||
retries: 20
|
||||
```
|
||||
|
||||
Some orchestration systems, such as Portainer, don't allow for disabling the default `HEALTHCHECK` declared by this image. In those cases you can approximate the disabling of healthchecks by setting the environment variable `DISABLE_HEALTHCHECK` to `true`.
|
||||
Some orchestration systems, such as Portainer, don't allow for disabling the default `HEALTHCHECK` declared by this image. In those cases you can approximate the disabling of health checks by setting the environment variable `DISABLE_HEALTHCHECK` to `true`.
|
||||
|
||||
### Healthchecks for older versions
|
||||
The [health check in a Compose service declaration](https://docs.docker.com/reference/compose-file/services/#healthcheck) can also be disabled using:
|
||||
|
||||
This container disables Healthchecks for Versions before b1.8 as those versions do not support any kind of server pinging.
|
||||
For more information see [Server List Ping](https://wiki.vg/Server_List_Ping#Beta_1.8_to_1.3)
|
||||
```yaml
|
||||
healthcheck:
|
||||
disable: true
|
||||
test: ["NONE"]
|
||||
```
|
||||
|
||||
### Health checks for older versions
|
||||
|
||||
This container disables health checks for Minecraft versions before b1.8 as those versions do not support any kind of server pinging. For more information see [Server List Ping](https://minecraft.wiki/w/Java_Edition_protocol/Server_List_Ping#Beta_1.8_to_1.3).
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
mkdocs-material == 9.6.16
|
||||
mkdocs-autorefs == 1.4.2
|
||||
mkdocs-material == 9.6.18
|
||||
mkdocs-autorefs == 1.4.3
|
||||
mkdocstrings[python] == 0.30.0
|
||||
mkdocs-literate-nav == 0.6.2
|
||||
mdx-gh-links == 0.4
|
||||
|
||||
@@ -12,6 +12,7 @@ To manage a CurseForge modpack automatically with upgrade support, pinned or lat
|
||||
|
||||
Example if your key is `$11$22$33aaaaaaaaaaaaaaaaaaaaaaaaaa`:
|
||||
```yaml
|
||||
# compose.yaml
|
||||
environment:
|
||||
CF_API_KEY: '$$11$$22$$33aaaaaaaaaaaaaaaaaaaaaaaaaa'
|
||||
```
|
||||
@@ -21,17 +22,35 @@ To manage a CurseForge modpack automatically with upgrade support, pinned or lat
|
||||
docker run ... -e CF_API_KEY='$11$22$33aaaaaaaaaaaaaaaaaaaaaaaaaa'
|
||||
```
|
||||
|
||||
To avoid exposing the API key, it is highly recommended to use a `.env` file, which is [loaded automatically by docker compose](https://docs.docker.com/compose/environment-variables/set-environment-variables/#substitute-with-an-env-file). `$`'s in the value still need to escaped with a second `$` and the variable needs to be referenced from the compose file, such as:
|
||||
To avoid exposing the API key, it is highly recommended to use a `.env` file, which is [loaded automatically by docker compose](https://docs.docker.com/compose/environment-variables/set-environment-variables/#substitute-with-an-env-file). You **do not** need to escape `$`'s with a second `$` in the `.env` file **as long as the key is wrapped in single quotes**.
|
||||
|
||||
```
|
||||
# .env
|
||||
CF_API_KEY='$11$22$33aaaaaaaaaaaaaaaaaaaaaaaaaa'
|
||||
```
|
||||
|
||||
The variable should to be referenced from the compose file, such as:
|
||||
|
||||
```yaml
|
||||
# compose.yaml
|
||||
environment:
|
||||
CF_API_KEY: ${CF_API_KEY}
|
||||
```
|
||||
|
||||
The .env file should be placed in the same directory as your compose file like so:
|
||||
|
||||
```
|
||||
/minecraft-server
|
||||
├── .env
|
||||
├── compose.yaml
|
||||
├── /data
|
||||
```
|
||||
|
||||
To use the equivalent with `docker run` you need to specify the `.env` file explicitly:
|
||||
```
|
||||
docker run --env-file=.env itzg/minecraft-server
|
||||
```
|
||||
|
||||
|
||||
Alternately you can use [docker secrets](https://docs.docker.com/compose/how-tos/use-secrets/) with a `CF_API_KEY_FILE` environment variable:
|
||||
```
|
||||
service:
|
||||
@@ -39,7 +58,7 @@ To manage a CurseForge modpack automatically with upgrade support, pinned or lat
|
||||
CF_API_KEY_FILE: /run/secrets/cf_api_key
|
||||
secrets:
|
||||
- cf_api_key
|
||||
|
||||
|
||||
secrets:
|
||||
cf_api_key:
|
||||
file: cf_api_key.secret
|
||||
|
||||
@@ -45,6 +45,11 @@ In both of the cases above, there is no need for the `VERSION` or `FORGE_VERSION
|
||||
|
||||
If an error occurred while installing Forge, it might be possible to resolve by temporarily setting `FORGE_FORCE_REINSTALL` to "true". Be sure to remove that variable after successfully starting the server.
|
||||
|
||||
URLs configurable via environment variables:
|
||||
|
||||
- `FORGE_PROMOTIONS_URL`: default is https://files.minecraftforge.net/net/minecraftforge/forge/promotions_slim.json
|
||||
- `FORGE_MAVEN_REPO_URL`: default is https://maven.minecraftforge.net
|
||||
|
||||
## Alternatives
|
||||
|
||||
### NeoForge
|
||||
|
||||
@@ -139,3 +139,7 @@ The following image tags have been deprecated and are no longer receiving update
|
||||
- java23-*
|
||||
- java8-multiarch is still built and pushed, but please move to java8 instead
|
||||
- java8-alpine, java8-jdk, java8-openj9, java8-graalvm-ce
|
||||
|
||||
## JSON Listing
|
||||
|
||||
Information about the image tags is available programmatically at <https://raw.githubusercontent.com/itzg/docker-minecraft-server/refs/heads/master/images.json>
|
||||
@@ -9,6 +9,7 @@ services:
|
||||
EULA: true
|
||||
ALLOW_FLIGHT: true
|
||||
MOD_PLATFORM: AUTO_CURSEFORGE
|
||||
CF_API_KEY: ${CF_API_KEY}
|
||||
CF_SLUG: craftoria
|
||||
MOTD: |
|
||||
A %TYPE% server on %VERSION%
|
||||
16
examples/auto-curseforge/skyfactory4/compose.yml
Normal file
16
examples/auto-curseforge/skyfactory4/compose.yml
Normal file
@@ -0,0 +1,16 @@
|
||||
services:
|
||||
mc:
|
||||
image: itzg/minecraft-server:java8
|
||||
environment:
|
||||
EULA: "true"
|
||||
MODPACK_PLATFORM: AUTO_CURSEFORGE
|
||||
CF_SLUG: skyfactory-4
|
||||
CF_FILENAME_MATCHER: 4.2.4
|
||||
CF_API_KEY: ${CF_API_KEY}
|
||||
MEMORY: 3G
|
||||
ports:
|
||||
- "25565:25565"
|
||||
volumes:
|
||||
- mc-data:/data
|
||||
volumes:
|
||||
mc-data:
|
||||
@@ -1,157 +0,0 @@
|
||||
####################################################################
|
||||
# FORGE GENERIC_PACK #
|
||||
# #
|
||||
# Date: 20220828 #
|
||||
# #
|
||||
# Mod: TNP Limitless 5 v2.19.0 #
|
||||
# #
|
||||
# Notes: Verify that there is no EULA file in the modpack.zip #
|
||||
# if you do not delete it the EULA flag below will be #
|
||||
# overwritten when the modpack is copied and the server #
|
||||
# will not start. #
|
||||
# #
|
||||
####################################################################
|
||||
services:
|
||||
|
||||
####################################################################
|
||||
# Service Name #
|
||||
# #
|
||||
# Define Service Name here. If using RCON this name will be #
|
||||
# referenced again as RWA_RCON_HOST below. #
|
||||
# #
|
||||
# Example: 'name:' or 'mc_atm6:' #
|
||||
####################################################################
|
||||
mc_tnp5:
|
||||
|
||||
####################################################################
|
||||
# Image & Container Name #
|
||||
# #
|
||||
# Specify Image Name and Java Version. The 'image' will always be #
|
||||
# 'itzg/minecraft-server' however the tag added to the end is #
|
||||
# where you can specify the java version or container architecture.#
|
||||
# See readme.md for a full list. #
|
||||
# #
|
||||
# 'container_name:' This can be anything you like. This is the name#
|
||||
# that will show when you run 'docker ps' commands. #
|
||||
####################################################################
|
||||
image: itzg/minecraft-server
|
||||
container_name: mc_tnp5
|
||||
|
||||
####################################################################
|
||||
# Server Ports #
|
||||
# #
|
||||
# Specify external port. #
|
||||
####################################################################
|
||||
ports:
|
||||
- 25565:25565
|
||||
|
||||
####################################################################
|
||||
# Automatic Server Restart #
|
||||
# #
|
||||
# Define a restart policy here. #
|
||||
# - 'no' = Do not restart. #
|
||||
# - 'on-failure' = Restart if container exits because an error. #
|
||||
# - 'always' = Regardless of stop reason. #
|
||||
# - 'unless-stopped' = Similar to always except if stopped. #
|
||||
####################################################################
|
||||
restart: unless-stopped
|
||||
|
||||
####################################################################
|
||||
# Volume and Folder Access #
|
||||
# #
|
||||
# This section defines what folders and volumes you want to give #
|
||||
# this container access to. It is recommended to leaves these set #
|
||||
# to the default values unless you know what you are doing. #
|
||||
# #
|
||||
# Place your mod zip file in a folder called 'modpacks' in the #
|
||||
# same directory you place this docker-compose file. #
|
||||
# #
|
||||
# Specify the data volume name or directory here as well. #
|
||||
# In this example the volume name is 'data'. When docker creates #
|
||||
# the volume it will add what ever name you give it here to the #
|
||||
# end of the container name specified above. In this example it #
|
||||
# would be named 'mc_atm6_data'. If you change this be sure to #
|
||||
# update the volume name at the bottom of this config. #
|
||||
####################################################################
|
||||
volumes:
|
||||
- ./modpacks:/modpacks:ro
|
||||
- data:/data
|
||||
|
||||
####################################################################
|
||||
# EULA #
|
||||
# #
|
||||
# Accept EULA by setting to "true" #
|
||||
####################################################################
|
||||
environment:
|
||||
EULA: "true"
|
||||
|
||||
####################################################################
|
||||
# FORGE INSTALL #
|
||||
# #
|
||||
# Sets install type to FORGE and specifys the zip folder name #
|
||||
# and location of your mod pack. #
|
||||
# #
|
||||
# TYPE: Defines the install type as FORGE #
|
||||
# #
|
||||
# VERSION: Defines the version of MC the modpack is based on. #
|
||||
# #
|
||||
# FORGE_VERSION: Defines the version of FORGE the modpack uses. #
|
||||
# This can usually be found in the modpack.zip as #
|
||||
# installer.jar #
|
||||
# #
|
||||
# GENERIC_PACK: Define where the modpack.zip is located. #
|
||||
# #
|
||||
# Place your mod zip file in a folder called 'modpacks' in the #
|
||||
# same directory you place this docker-compose file. #
|
||||
####################################################################
|
||||
TYPE: FORGE
|
||||
VERSION: 1.18.2
|
||||
FORGE_VERSION: 40.1.73
|
||||
GENERIC_PACK: /modpacks/tnp5.zip
|
||||
|
||||
####################################################################
|
||||
# Server Memory #
|
||||
# #
|
||||
# Set Maximum amount of memory allowed for your server. #
|
||||
####################################################################
|
||||
MEMORY: "8G"
|
||||
|
||||
####################################################################
|
||||
# Logging Options #
|
||||
# #
|
||||
# Set to "true" to delete old logs #
|
||||
####################################################################
|
||||
ENABLE_ROLLING_LOGS: "true"
|
||||
|
||||
####################################################################
|
||||
# Server Timezone #
|
||||
# #
|
||||
# Specify server Timezone #
|
||||
####################################################################
|
||||
TZ: "America/New_York"
|
||||
|
||||
####################################################################
|
||||
# Minecraft Game Options #
|
||||
# #
|
||||
# List any game options you want to define here. A full list can #
|
||||
# be found on the readme.md page on github. #
|
||||
####################################################################
|
||||
OVERRIDE_SERVER_PROPERTIES: "true"
|
||||
DIFFICULTY: "easy"
|
||||
MAX_TICK_TIME: "-1"
|
||||
VIEW_DISTANCE: "6"
|
||||
ALLOW_FLIGHT: "true"
|
||||
OPS: ""
|
||||
MAX_PLAYERS: 10
|
||||
PVP: "false"
|
||||
LEVEL_TYPE: "biomesoplenty"
|
||||
MOTD: "Welcome Home"
|
||||
|
||||
####################################################################
|
||||
# Volumes #
|
||||
# #
|
||||
# Define data volume name here. You should leave this set to the #
|
||||
# default. #
|
||||
####################################################################
|
||||
volumes:
|
||||
data:
|
||||
@@ -1,19 +0,0 @@
|
||||
services:
|
||||
mc:
|
||||
image: itzg/minecraft-server:${IMAGE_TAG:-latest}
|
||||
volumes:
|
||||
- data:/data
|
||||
- ./modpacks:/modpacks:ro
|
||||
environment:
|
||||
EULA: "true"
|
||||
TYPE: FORGE
|
||||
DEBUG: "${DEBUG:-false}"
|
||||
VERSION: ${VERSION:-1.17.1}
|
||||
FORGE_VERSION: ${FORGE_VERSION:-37.0.90}
|
||||
GENERIC_PACK: /modpacks/${MODPACK:-Server-Files-0.0.21.zip}
|
||||
REMOVE_OLD_MODS: "${REMOVE_OLD_MODS:-false}"
|
||||
ports:
|
||||
- "25565:25565"
|
||||
|
||||
volumes:
|
||||
data: {}
|
||||
@@ -12,6 +12,9 @@ services:
|
||||
# Use Pack ID from https://www.feed-the-beast.com/modpacks/119-ftb-presents-direwolf20-120?tab=about
|
||||
FTB_MODPACK_ID: "119"
|
||||
# FTB_MODPACK_VERSION_ID: ""
|
||||
MOTD: |
|
||||
An FTB server running
|
||||
%MODPACK_NAME% version %MODPACK_VERSION%
|
||||
MEMORY: 4G
|
||||
volumes:
|
||||
# use a named, managed volume for data volume
|
||||
|
||||
@@ -10,6 +10,6 @@ services:
|
||||
griefprevention
|
||||
discordsrv
|
||||
VERSION_FROM_MODRINTH_PROJECTS: true
|
||||
SETUP_ONLY: true
|
||||
MEMORY: 2G
|
||||
ports:
|
||||
- "25565:25565"
|
||||
@@ -7,7 +7,7 @@ services:
|
||||
EULA: "TRUE"
|
||||
TYPE: MOHIST
|
||||
VERSION: 1.12.2
|
||||
DEBUG: "true"
|
||||
MOHIST_BUILD: 347
|
||||
volumes:
|
||||
- data:/data
|
||||
|
||||
@@ -157,6 +157,7 @@
|
||||
"vanillafix",
|
||||
"visuality",
|
||||
"waila-harvestability",
|
||||
"waila-stages",
|
||||
"wakes-reforged",
|
||||
"wawla",
|
||||
"welcome-screen",
|
||||
@@ -169,7 +170,7 @@
|
||||
"forceIncludes": ["revelationary"]
|
||||
},
|
||||
"beyond-depth": {
|
||||
"forceIncludes": ["particular-reforged"]
|
||||
"forceIncludes": ["particular-reforged"]
|
||||
},
|
||||
"create-arcane-engineering": {
|
||||
"forceIncludes": ["just-enough-resources-jer"]
|
||||
@@ -183,6 +184,12 @@
|
||||
},
|
||||
"valhelsia-5": {
|
||||
"excludes": ["modernfix"]
|
||||
},
|
||||
"mc-eternal-2": {
|
||||
"forceIncludes": [
|
||||
"particular-reforged",
|
||||
"mob-player-animator"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -10,8 +10,9 @@
|
||||
"axolotlbuckets",
|
||||
"BadOptimizations",
|
||||
"BetterAdvancements",
|
||||
"BetterGrassify",
|
||||
"betterbeds",
|
||||
"BetterF3",
|
||||
"BetterGrassify",
|
||||
"BetterThirdPerson",
|
||||
"BHMenu",
|
||||
"blur",
|
||||
@@ -23,16 +24,21 @@
|
||||
"cherishedworlds",
|
||||
"citresewn",
|
||||
"clickadv",
|
||||
"cobblemon-ui-tweaks",
|
||||
"compass-coords",
|
||||
"connectedness",
|
||||
"connector",
|
||||
"continuity",
|
||||
"controlling",
|
||||
"craftpresence",
|
||||
"cwb",
|
||||
"DisableCustomWorldsAdvice",
|
||||
"distraction_free_recipes",
|
||||
"drippyloadingscreen",
|
||||
"eating-animation",
|
||||
"emi",
|
||||
"emi_loot",
|
||||
"emi_trade",
|
||||
"emiffect",
|
||||
"emitrades",
|
||||
"entity_model_features",
|
||||
@@ -52,6 +58,7 @@
|
||||
"Highlighter",
|
||||
"ImmediatelyFast",
|
||||
"indium",
|
||||
"inventory-profiles-next",
|
||||
"iris",
|
||||
"iris-flywheel",
|
||||
"ItemBorders",
|
||||
@@ -71,9 +78,10 @@
|
||||
"PickUpNotifier",
|
||||
"PresenceFootsteps",
|
||||
"Prism",
|
||||
"reforgium",
|
||||
"reeses_sodium_options",
|
||||
"reforgium",
|
||||
"ResourcePackOverrides",
|
||||
"roughly-enough-items",
|
||||
"ryoamiclights",
|
||||
"screenshot_viewer",
|
||||
"Searchables",
|
||||
@@ -82,14 +90,24 @@
|
||||
"skinlayers3d",
|
||||
"sodium",
|
||||
"sorted_enchantments",
|
||||
"tooltipfix",
|
||||
"visuality",
|
||||
"VR-Combat",
|
||||
"WailaStages",
|
||||
"welcomescreen",
|
||||
"Xaeros_Minimap",
|
||||
"XaerosWorldMap",
|
||||
"YeetusExperimentus",
|
||||
"yungsmenutweaks",
|
||||
"Zoomify",
|
||||
"zume"
|
||||
],
|
||||
"globalForceIncludes": [],
|
||||
"modpacks": {}
|
||||
"modpacks": {
|
||||
"cobbleverse": {
|
||||
"excludes": [
|
||||
"cloth-config"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -28,6 +28,9 @@
|
||||
"level-seed": {"env": "SEED"},
|
||||
"level-type": {"env": "LEVEL_TYPE"},
|
||||
"log-ips": {"env": "LOG_IPS"},
|
||||
"management-server-enabled": {"env": "MANAGEMENT_SERVER_ENABLED"},
|
||||
"management-server-host": {"env": "MANAGEMENT_SERVER_HOST"},
|
||||
"management-server-port": {"env": "MANAGEMENT_SERVER_PORT"},
|
||||
"max-build-height": {"env": "MAX_BUILD_HEIGHT"},
|
||||
"max-chained-neighbor-updates": {"env": "MAX_CHAINED_NEIGHBOR_UPDATES"},
|
||||
"max-players": {"env": "MAX_PLAYERS"},
|
||||
@@ -61,6 +64,7 @@
|
||||
"spawn-monsters": {"env": "SPAWN_MONSTERS"},
|
||||
"spawn-npcs": {"env": "SPAWN_NPCS"},
|
||||
"spawn-protection": {"env": "SPAWN_PROTECTION"},
|
||||
"status-heartbeat-interval": {"env": "STATUS_HEARTBEAT_INTERVAL"},
|
||||
"sync-chunk-writes": {"env": "SYNC_CHUNK_WRITES"},
|
||||
"use-native-transport": {"env": "USE_NATIVE_TRANSPORT"},
|
||||
"view-distance": {"env": "VIEW_DISTANCE"},
|
||||
|
||||
0
bin/mc-health → files/shims/mc-health
Executable file → Normal file
0
bin/mc-health → files/shims/mc-health
Executable file → Normal file
0
bin/mc-send-to-console → files/shims/mc-send-to-console
Executable file → Normal file
0
bin/mc-send-to-console → files/shims/mc-send-to-console
Executable file → Normal file
0
bin/mcstatus → files/shims/mcstatus
Executable file → Normal file
0
bin/mcstatus → files/shims/mcstatus
Executable file → Normal file
134
images.json
Normal file
134
images.json
Normal file
@@ -0,0 +1,134 @@
|
||||
[
|
||||
{
|
||||
"tag": "latest",
|
||||
"notes": "Always tracks the most recent commit on the main branch",
|
||||
"java": "21",
|
||||
"distribution": "ubuntu",
|
||||
"jvm": "hotspot",
|
||||
"architectures": ["amd64", "arm64"],
|
||||
"lts": true
|
||||
},
|
||||
{
|
||||
"tag": "stable",
|
||||
"notes": "Always tracks the most recent release",
|
||||
"java": "21",
|
||||
"distribution": "ubuntu",
|
||||
"jvm": "hotspot",
|
||||
"architectures": ["amd64", "arm64"],
|
||||
"lts": true
|
||||
},
|
||||
{
|
||||
"tag": "java24",
|
||||
"java": "24",
|
||||
"distribution": "ubuntu",
|
||||
"jvm": "hotspot",
|
||||
"architectures": ["amd64", "arm64"]
|
||||
},
|
||||
{
|
||||
"tag": "java24-graalvm",
|
||||
"java": "24",
|
||||
"distribution": "oracle",
|
||||
"jvm": "graalvm",
|
||||
"architectures": ["amd64", "arm64"]
|
||||
},
|
||||
{
|
||||
"tag": "java21",
|
||||
"java": "21",
|
||||
"distribution": "ubuntu",
|
||||
"jvm": "hotspot",
|
||||
"architectures": ["amd64", "arm64"],
|
||||
"lts": true
|
||||
},
|
||||
{
|
||||
"tag": "java21-alpine",
|
||||
"java": "21",
|
||||
"distribution": "alpine",
|
||||
"jvm": "hotspot",
|
||||
"architectures": ["amd64", "arm64"]
|
||||
},
|
||||
{
|
||||
"tag": "java21-graalvm",
|
||||
"java": "21",
|
||||
"distribution": "oracle",
|
||||
"jvm": "graalvm",
|
||||
"architectures": ["amd64", "arm64"],
|
||||
},
|
||||
{
|
||||
"tag": "java21-jdk",
|
||||
"java": "21",
|
||||
"distribution": "ubuntu",
|
||||
"jvm": "hotspot",
|
||||
"architectures": ["amd64", "arm64"],
|
||||
"jdk": true
|
||||
},
|
||||
{
|
||||
"tag": "java21-graalvm",
|
||||
"java": "21",
|
||||
"distribution": "oracle",
|
||||
"jvm": "graalvm",
|
||||
"architectures": ["amd64", "arm64"],
|
||||
},
|
||||
{
|
||||
"tag": "java17",
|
||||
"java": "17",
|
||||
"distribution": "ubuntu",
|
||||
"jvm": "hotspot",
|
||||
"architectures": ["amd64", "arm64"],
|
||||
"lts": true
|
||||
},
|
||||
{
|
||||
"tag": "java17-alpine",
|
||||
"java": "17",
|
||||
"distribution": "alpine",
|
||||
"jvm": "hotspot",
|
||||
"architectures": ["amd64", "arm64"]
|
||||
},
|
||||
{
|
||||
"tag": "java17-graalvm",
|
||||
"java": "17",
|
||||
"distribution": "oracle",
|
||||
"jvm": "graalvm",
|
||||
"architectures": ["amd64", "arm64"]
|
||||
},
|
||||
{
|
||||
"tag": "java16",
|
||||
"java": "16",
|
||||
"distribution": "ubuntu",
|
||||
"jvm": "hotspot",
|
||||
"architectures": ["amd64", "arm64", "armv7"]
|
||||
},
|
||||
{
|
||||
"tag": "java11",
|
||||
"java": "11",
|
||||
"distribution": "ubuntu",
|
||||
"jvm": "hotspot",
|
||||
"architectures": ["amd64", "arm64", "armv7"],
|
||||
"lts": true
|
||||
},
|
||||
{
|
||||
"tag": "java8",
|
||||
"java": "8",
|
||||
"distribution": "ubuntu",
|
||||
"jvm": "hotspot",
|
||||
"architectures": ["amd64", "arm64", "armv7"],
|
||||
"lts": true
|
||||
},
|
||||
{"tag": "adopt13", "deprecated": true},
|
||||
{"tag": "adopt14", "deprecated": true},
|
||||
{"tag": "adopt15", "deprecated": true},
|
||||
{"tag": "openj9-nightly", "deprecated": true},
|
||||
{"tag": "multiarch-latest", "deprecated": true},
|
||||
{"tag": "java16-openj9", "deprecated": true},
|
||||
{"tag": "java17-graalvm-ce", "deprecated": true},
|
||||
{"tag": "java17-openj9", "deprecated": true},
|
||||
{"tag": "java19", "deprecated": true},
|
||||
{"tag": "java20-graalvm", "deprecated": true},
|
||||
{"tag": "java20", "deprecated": true},
|
||||
{"tag": "java20-alpine", "deprecated": true},
|
||||
{"tag": "java23", "deprecated": true},
|
||||
{"tag": "java8-multiarch", "deprecated": true},
|
||||
{"tag": "java8-alpine", "deprecated": true},
|
||||
{"tag": "java8-jdk", "deprecated": true},
|
||||
{"tag": "java8-openj9", "deprecated": true},
|
||||
{"tag": "java8-graalvm-ce", "deprecated": true}
|
||||
]
|
||||
@@ -50,7 +50,7 @@ fi
|
||||
|
||||
if isTrue "${DEBUG_MEMORY:-false}"; then
|
||||
log "Memory usage and availability (in MB)"
|
||||
uname -a
|
||||
uname -pars
|
||||
free -m
|
||||
fi
|
||||
|
||||
@@ -101,21 +101,38 @@ if isTrue "${ENABLE_AUTOPAUSE}" && isTrue "${ENABLE_AUTOSTOP}"; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
proxyArgs=()
|
||||
if [[ $PROXY ]]; then
|
||||
export http_proxy="$PROXY"
|
||||
export https_proxy="$PROXY"
|
||||
export JAVA_TOOL_OPTIONS+="-Djava.net.useSystemProxies=true"
|
||||
log "INFO: Giving proxy time to startup..."
|
||||
sleep 5
|
||||
|
||||
IFS=":"
|
||||
read -ra parts <<< "$PROXY"
|
||||
IFS=" "
|
||||
: "${PROXY_HOST=$(firstArrayElement parts)}"
|
||||
shiftArray parts
|
||||
: "${PROXY_PORT=$(firstArrayElement parts)}"
|
||||
fi
|
||||
|
||||
# https://docs.oracle.com/javase/7/docs/api/java/net/doc-files/net-properties.html
|
||||
proxyArgs=()
|
||||
function addToProxyArgs() {
|
||||
if [[ $2 ]]; then
|
||||
proxyArgs+=("-D$1=$2")
|
||||
fi
|
||||
}
|
||||
addToProxyArgs http.proxyHost "${PROXY_HOST:-}"
|
||||
addToProxyArgs http.proxyPort "${PROXY_PORT:-}"
|
||||
addToProxyArgs http.nonProxyHosts "${PROXY_NON_PROXY_HOSTS:-}"
|
||||
export MC_IMAGE_HELPER_OPTS+=" ${proxyArgs[*]}"
|
||||
|
||||
function fixJavaPath() {
|
||||
# Some Docker management UIs grab all the image declared variables and present them for configuration.
|
||||
# When upgrading images across Java versions, that creates a mismatch in PATH's expected by base image.
|
||||
# When upgrading images across Java versions, that creates parts mismatch in PATH's expected by base image.
|
||||
if ! which java > /dev/null; then
|
||||
logError " Your Docker provider has an annoying flaw where it"
|
||||
logError " tries to set PATH even though the container establishes"
|
||||
logError " a very specific value."
|
||||
logError " parts very specific value."
|
||||
sleep 2
|
||||
# now find where java might be
|
||||
for d in /opt/java/openjdk/bin /usr/bin; do
|
||||
|
||||
@@ -36,6 +36,12 @@ function getModLoaderVersion() {
|
||||
function getMinecraftVersion() {
|
||||
jq -r ".modPackTargets.mcVersion" ${ftbManifest}
|
||||
}
|
||||
function getModpackName() {
|
||||
jq -r ".name" ${ftbManifest}
|
||||
}
|
||||
function getModpackVersion() {
|
||||
jq -r ".versionName" ${ftbManifest}
|
||||
}
|
||||
|
||||
if [[ $(getDistro) = alpine ]]; then
|
||||
logError "The FTBA installer is not supported on Alpine. Use the java8-multiarch image tag instead."
|
||||
@@ -102,7 +108,9 @@ modLoader="$(getModLoaderName)"
|
||||
modLoaderVersion="$(getModLoaderVersion)"
|
||||
mcVersion=$(getMinecraftVersion)
|
||||
VERSION="$mcVersion"
|
||||
export VERSION
|
||||
MODPACK_NAME=$(getModpackName)
|
||||
MODPACK_VERSION=$(getModpackVersion)
|
||||
export VERSION MODPACK_NAME MODPACK_VERSION
|
||||
|
||||
variants=(
|
||||
run.sh
|
||||
|
||||
@@ -14,6 +14,7 @@ resultsFile=/data/.install-modrinth.env
|
||||
: "${MODRINTH_FORCE_INCLUDE_FILES=}"
|
||||
: "${MODRINTH_OVERRIDES_EXCLUSIONS=}"
|
||||
: "${MODRINTH_DEFAULT_EXCLUDE_INCLUDES=/image/modrinth-exclude-include.json}"
|
||||
: "${MODRINTH_FORCE_MODLOADER_REINSTALL:=${FORCE_MODLOADER_REINSTALL:-false}}"
|
||||
|
||||
if [[ ! $MODRINTH_MODPACK ]]; then
|
||||
logError "MODRINTH_MODPACK must be set when using TYPE/MODPACK_PLATFORM/MOD_PLATFORM of MODRINTH"
|
||||
@@ -33,6 +34,9 @@ args=(
|
||||
if [[ $MODRINTH_IGNORE_MISSING_FILES ]]; then
|
||||
args+=(--ignore-missing-files "$MODRINTH_IGNORE_MISSING_FILES")
|
||||
fi
|
||||
if isTrue "${MODRINTH_FORCE_MODLOADER_REINSTALL}"; then
|
||||
args+=(--force-modloader-reinstall)
|
||||
fi
|
||||
|
||||
case "${VERSION^^}" in
|
||||
LATEST)
|
||||
|
||||
@@ -14,38 +14,39 @@ mohistType="${TYPE,,}"
|
||||
mohistApiUrl="https://api.mohistmc.com/project/${mohistType}"
|
||||
mohistDownloadsPage="https://mohistmc.com/downloadSoftware?project=${mohistType}"
|
||||
|
||||
if ! get --exists "${mohistApiUrl}/${VERSION}/builds"; then
|
||||
logError "${mohistType} builds do not exist for ${VERSION}"
|
||||
logError " check ${mohistDownloadsPage} for available versions"
|
||||
logError " and set VERSION accordingly"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [[ "${MOHIST_BUILD}" == "lastSuccessfulBuild" ]]; then
|
||||
# Get the latest build number from the API
|
||||
if ! buildNumber=$(
|
||||
get --json-path '$[0].id' "${mohistApiUrl}/${VERSION}/builds"
|
||||
); then
|
||||
logError "failed to list ${mohistType} builds for ${VERSION}"
|
||||
if [[ "${MOHIST_BUILD}" != "lastSuccessfulBuild" ]] && [[ "${VERSION,,}" != latest ]] && [[ -f "/data/${mohistType}-${VERSION}-${MOHIST_BUILD}-server.jar" ]]; then
|
||||
log "Skipping Mohist build lookup since server jar exists"
|
||||
SERVER="/data/${mohistType}-${VERSION}-${MOHIST_BUILD}-server.jar"
|
||||
else
|
||||
if ! get --exists "${mohistApiUrl}/${VERSION}/builds"; then
|
||||
logError "${mohistType} builds do not exist for ${VERSION}"
|
||||
logError " check ${mohistDownloadsPage} for available versions"
|
||||
logError " and set VERSION accordingly"
|
||||
exit 1
|
||||
fi
|
||||
MOHIST_BUILD="${buildNumber}"
|
||||
fi
|
||||
|
||||
downloadUrl="${mohistApiUrl}/${VERSION}/builds/${MOHIST_BUILD}/download"
|
||||
if [[ "${MOHIST_BUILD}" == "lastSuccessfulBuild" ]]; then
|
||||
# Get the latest build number from the API
|
||||
if ! buildNumber=$(
|
||||
get --json-path '$[0].id' "${mohistApiUrl}/${VERSION}/builds"
|
||||
); then
|
||||
logError "failed to list ${mohistType} builds for ${VERSION}"
|
||||
exit 1
|
||||
fi
|
||||
MOHIST_BUILD="${buildNumber}"
|
||||
fi
|
||||
|
||||
if [[ -z "${downloadUrl}" ]]; then
|
||||
logError "Could not find build ${MOHIST_BUILD} for version ${VERSION}"
|
||||
logError " check ${mohistDownloadsPage} for available versions"
|
||||
logError " and set VERSION accordingly"
|
||||
exit 1
|
||||
fi
|
||||
downloadUrl="${mohistApiUrl}/${VERSION}/builds/${MOHIST_BUILD}/download"
|
||||
|
||||
SERVER="/data/${mohistType}-${VERSION}-${MOHIST_BUILD}-server.jar"
|
||||
if [[ -z "${downloadUrl}" ]]; then
|
||||
logError "Could not find build ${MOHIST_BUILD} for version ${VERSION}"
|
||||
logError " check ${mohistDownloadsPage} for available versions"
|
||||
logError " and set VERSION accordingly"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ ! -f "${SERVER}" ]; then
|
||||
log "Downloading ${mohistType^} build ${MOHIST_BUILD} for ${VERSION}"
|
||||
get -o "${SERVER}" "${downloadUrl}"
|
||||
SERVER="/data/${mohistType}-${VERSION}-${MOHIST_BUILD}-server.jar"
|
||||
get --skip-existing -o "${SERVER}" "${downloadUrl}"
|
||||
fi
|
||||
|
||||
if [[ "${mohistType}" == "mohist" ]]; then
|
||||
|
||||
@@ -151,16 +151,19 @@ if isTrue "${ENABLE_JMX}"; then
|
||||
log "JMX is enabled. Make sure you have port forwarding for ${JMX_PORT}"
|
||||
fi
|
||||
|
||||
: "${USE_AIKAR_FLAGS:=false}"
|
||||
: "${USE_MEOWICE_FLAGS:=false}"
|
||||
: "${USE_MEOWICE_GRAALVM_FLAGS:=false}"
|
||||
|
||||
if isTrue "${USE_MEOWICE_FLAGS}"; then
|
||||
java_major_version=$(mc-image-helper java-release)
|
||||
if [[ $java_major_version -gt 16 ]]; then
|
||||
USE_MEOWICE_GRAALVM_FLAGS="${USE_MEOWICE_GRAALVM_FLAGS:-TRUE}"
|
||||
log "Java version $java_major_version using MeowIce's flags for Java 17+"
|
||||
else
|
||||
log "Your Java version is $java_major_version, MeowIce's flags are for Java 17+ falling back to Aikar's"
|
||||
USE_MEOWICE_FLAGS=FALSE
|
||||
USE_AIKAR_FLAGS=TRUE
|
||||
fi
|
||||
USE_AIKAR_FLAGS=TRUE
|
||||
fi
|
||||
|
||||
if isTrue "${USE_AIKAR_FLAGS}"; then
|
||||
@@ -221,6 +224,7 @@ fi
|
||||
if isTrue "${USE_MEOWICE_FLAGS}"; then
|
||||
JVM_XX_OPTS="${JVM_XX_OPTS}
|
||||
-XX:+UnlockDiagnosticVMOptions
|
||||
-XX:+UnlockExperimentalVMOptions
|
||||
-XX:G1SATBBufferEnqueueingThresholdPercent=30
|
||||
-XX:G1ConcMarkStepDurationMillis=5
|
||||
-XX:+UseNUMA
|
||||
|
||||
@@ -538,4 +538,18 @@ function buildDownloadList() {
|
||||
result+="${repoUrl}/${version}/$c"
|
||||
done
|
||||
echo "$result"
|
||||
}
|
||||
}
|
||||
|
||||
function firstArrayElement {
|
||||
local -n a="$1"
|
||||
if (( ${#a[@]} )); then
|
||||
echo "${a[0]}"
|
||||
fi
|
||||
}
|
||||
|
||||
function shiftArray {
|
||||
local -n a="$1"
|
||||
if (( ${#a[@]} )); then
|
||||
a=("${a[@]:1}")
|
||||
fi
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user