Populate MODPACK_NAME and MODPACK_VERSION from FTB modpacks (#3602)

This commit is contained in:
Geoff Bourne
2025-08-08 13:18:31 -05:00
committed by GitHub
parent d5d1592c38
commit 37d2aebb1e
3 changed files with 25 additions and 7 deletions

View File

@@ -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).

View File

@@ -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

View File

@@ -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