mirror of
https://github.com/itzg/docker-minecraft-server.git
synced 2026-09-11 00:17:58 +00:00
Compare commits
1
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
78c24b580e |
@@ -138,7 +138,7 @@ jobs:
|
|||||||
uses: docker/setup-qemu-action@v3.1.0
|
uses: docker/setup-qemu-action@v3.1.0
|
||||||
|
|
||||||
- name: Build for test
|
- name: Build for test
|
||||||
uses: docker/build-push-action@v6.3.0
|
uses: docker/build-push-action@v5.4.0
|
||||||
with:
|
with:
|
||||||
platforms: linux/amd64
|
platforms: linux/amd64
|
||||||
tags: ${{ env.IMAGE_TO_TEST }}
|
tags: ${{ env.IMAGE_TO_TEST }}
|
||||||
@@ -176,7 +176,7 @@ jobs:
|
|||||||
password: ${{ github.token }}
|
password: ${{ github.token }}
|
||||||
|
|
||||||
- name: Build and push
|
- name: Build and push
|
||||||
uses: docker/build-push-action@v6.3.0
|
uses: docker/build-push-action@v5.4.0
|
||||||
if: github.actor == github.repository_owner
|
if: github.actor == github.repository_owner
|
||||||
with:
|
with:
|
||||||
platforms: ${{ matrix.platforms }}
|
platforms: ${{ matrix.platforms }}
|
||||||
|
|||||||
@@ -55,7 +55,7 @@ jobs:
|
|||||||
uses: docker/setup-buildx-action@v3.4.0
|
uses: docker/setup-buildx-action@v3.4.0
|
||||||
|
|
||||||
- name: Confirm multi-arch build
|
- name: Confirm multi-arch build
|
||||||
uses: docker/build-push-action@v6.3.0
|
uses: docker/build-push-action@v5.4.0
|
||||||
with:
|
with:
|
||||||
platforms: ${{ matrix.platforms }}
|
platforms: ${{ matrix.platforms }}
|
||||||
# ensure latest base image is used
|
# ensure latest base image is used
|
||||||
@@ -65,7 +65,7 @@ jobs:
|
|||||||
cache-from: type=gha,scope=${{ matrix.variant }}
|
cache-from: type=gha,scope=${{ matrix.variant }}
|
||||||
|
|
||||||
- name: Build for test
|
- name: Build for test
|
||||||
uses: docker/build-push-action@v6.3.0
|
uses: docker/build-push-action@v5.4.0
|
||||||
with:
|
with:
|
||||||
# Only build single platform since loading multi-arch image into daemon fails with
|
# Only build single platform since loading multi-arch image into daemon fails with
|
||||||
# "docker exporter does not currently support exporting manifest lists"
|
# "docker exporter does not currently support exporting manifest lists"
|
||||||
|
|||||||
+4
-4
@@ -23,11 +23,11 @@ EXPOSE 25565
|
|||||||
ARG APPS_REV=1
|
ARG APPS_REV=1
|
||||||
ARG GITHUB_BASEURL=https://github.com
|
ARG GITHUB_BASEURL=https://github.com
|
||||||
|
|
||||||
ARG EASY_ADD_VERSION=0.8.7
|
ARG EASY_ADD_VERSION=0.8.6
|
||||||
ADD ${GITHUB_BASEURL}/itzg/easy-add/releases/download/${EASY_ADD_VERSION}/easy-add_${TARGETOS}_${TARGETARCH}${TARGETVARIANT} /usr/bin/easy-add
|
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
|
RUN chmod +x /usr/bin/easy-add
|
||||||
|
|
||||||
ARG RESTIFY_VERSION=1.7.4
|
ARG RESTIFY_VERSION=1.7.3
|
||||||
RUN easy-add --var os=${TARGETOS} --var arch=${TARGETARCH}${TARGETVARIANT} \
|
RUN easy-add --var os=${TARGETOS} --var arch=${TARGETARCH}${TARGETVARIANT} \
|
||||||
--var version=${RESTIFY_VERSION} --var app=restify --file {{.app}} \
|
--var version=${RESTIFY_VERSION} --var app=restify --file {{.app}} \
|
||||||
--from ${GITHUB_BASEURL}/itzg/{{.app}}/releases/download/{{.version}}/{{.app}}_{{.version}}_{{.os}}_{{.arch}}.tar.gz
|
--from ${GITHUB_BASEURL}/itzg/{{.app}}/releases/download/{{.version}}/{{.app}}_{{.version}}_{{.os}}_{{.arch}}.tar.gz
|
||||||
@@ -37,7 +37,7 @@ RUN easy-add --var os=${TARGETOS} --var arch=${TARGETARCH}${TARGETVARIANT} \
|
|||||||
--var version=${RCON_CLI_VERSION} --var app=rcon-cli --file {{.app}} \
|
--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
|
--from ${GITHUB_BASEURL}/itzg/{{.app}}/releases/download/{{.version}}/{{.app}}_{{.version}}_{{.os}}_{{.arch}}.tar.gz
|
||||||
|
|
||||||
ARG MC_MONITOR_VERSION=0.12.13
|
ARG MC_MONITOR_VERSION=0.12.12
|
||||||
RUN easy-add --var os=${TARGETOS} --var arch=${TARGETARCH}${TARGETVARIANT} \
|
RUN easy-add --var os=${TARGETOS} --var arch=${TARGETARCH}${TARGETVARIANT} \
|
||||||
--var version=${MC_MONITOR_VERSION} --var app=mc-monitor --file {{.app}} \
|
--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
|
--from ${GITHUB_BASEURL}/itzg/{{.app}}/releases/download/{{.version}}/{{.app}}_{{.version}}_{{.os}}_{{.arch}}.tar.gz
|
||||||
@@ -47,7 +47,7 @@ RUN easy-add --var os=${TARGETOS} --var arch=${TARGETARCH}${TARGETVARIANT} \
|
|||||||
--var version=${MC_SERVER_RUNNER_VERSION} --var app=mc-server-runner --file {{.app}} \
|
--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
|
--from ${GITHUB_BASEURL}/itzg/{{.app}}/releases/download/{{.version}}/{{.app}}_{{.version}}_{{.os}}_{{.arch}}.tar.gz
|
||||||
|
|
||||||
ARG MC_HELPER_VERSION=1.39.7
|
ARG MC_HELPER_VERSION=1.39.3
|
||||||
ARG MC_HELPER_BASE_URL=${GITHUB_BASEURL}/itzg/mc-image-helper/releases/download/${MC_HELPER_VERSION}
|
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
|
# used for cache busting local copy of mc-image-helper
|
||||||
ARG MC_HELPER_REV=1
|
ARG MC_HELPER_REV=1
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
An option to stop the server after a specified time has been added for niche applications (e.g. billing saving on AWS Fargate). The function is incompatible with the Autopause functionality, as they basically cancel out each other.
|
An option to stop the server after a specified time has been added for niche applications (e.g. billing saving on AWS Fargate). The function is incompatible with the Autopause functionality, as they basically cancel out each other.
|
||||||
|
|
||||||
!!! note
|
!!! note
|
||||||
|
|
||||||
the docker container variables have to be set accordingly (restart policy set to "no") and that the container has to be manually restarted.
|
the docker container variables have to be set accordingly (restart policy set to "no") and that the container has to be manually restarted.
|
||||||
|
|
||||||
@@ -25,6 +25,3 @@ The following environment variables define the behavior of auto-stopping:
|
|||||||
describes period of the daemonized state machine, that handles the stopping of the server
|
describes period of the daemonized state machine, that handles the stopping of the server
|
||||||
|
|
||||||
> To troubleshoot, add `DEBUG_AUTOSTOP=true` to see additional output
|
> To troubleshoot, add `DEBUG_AUTOSTOP=true` to see additional output
|
||||||
|
|
||||||
## Proxy Support
|
|
||||||
If you make use of PROXY Protocol, i.e. through something like HAProxy or Fly.io, you will need to enable it in your variety of server's configuration, and then set the `USES_PROXY_PROTOCOL` envar to `true`. This lets Autostop monitor the server, where it otherwise wouldn't
|
|
||||||
|
|||||||
@@ -1,7 +1,5 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
# shellcheck source=../scripts/start-utils
|
|
||||||
. "${SCRIPTS:-/}start-utils"
|
|
||||||
current_uptime() {
|
current_uptime() {
|
||||||
awk '{print $1}' /proc/uptime | cut -d . -f 1
|
awk '{print $1}' /proc/uptime | cut -d . -f 1
|
||||||
}
|
}
|
||||||
@@ -18,20 +16,14 @@ rcon_client_exists() {
|
|||||||
[[ -n "$(ps -ax -o comm | grep 'rcon-cli')" ]]
|
[[ -n "$(ps -ax -o comm | grep 'rcon-cli')" ]]
|
||||||
}
|
}
|
||||||
|
|
||||||
use_proxy() {
|
|
||||||
if isTrue "$USES_PROXY_PROTOCOL"; then
|
|
||||||
echo "--use-proxy"
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
mc_server_listening() {
|
mc_server_listening() {
|
||||||
mc-monitor status $(use_proxy) --host "${SERVER_HOST:-localhost}" --port "$SERVER_PORT" --timeout 10s >&/dev/null
|
mc-monitor status --host "${SERVER_HOST:-localhost}" --port "$SERVER_PORT" --timeout 10s >& /dev/null
|
||||||
}
|
}
|
||||||
|
|
||||||
java_clients_connections() {
|
java_clients_connections() {
|
||||||
local connections
|
local connections
|
||||||
if java_running; then
|
if java_running ; then
|
||||||
if ! connections=$(mc-monitor status $(use_proxy) --host "${SERVER_HOST:-localhost}" --port "$SERVER_PORT" --show-player-count); then
|
if ! connections=$(mc-monitor status --host "${SERVER_HOST:-localhost}" --port "$SERVER_PORT" --show-player-count); then
|
||||||
# consider it a non-zero player count if the ping fails
|
# consider it a non-zero player count if the ping fails
|
||||||
# otherwise a laggy server with players connected could get paused
|
# otherwise a laggy server with players connected could get paused
|
||||||
connections=1
|
connections=1
|
||||||
|
|||||||
@@ -66,6 +66,7 @@
|
|||||||
"more-overlays",
|
"more-overlays",
|
||||||
"mouse-tweaks",
|
"mouse-tweaks",
|
||||||
"neat",
|
"neat",
|
||||||
|
"necronomicon",
|
||||||
"nekos-enchanted-books",
|
"nekos-enchanted-books",
|
||||||
"no-recipe-book",
|
"no-recipe-book",
|
||||||
"no-nv-flash",
|
"no-nv-flash",
|
||||||
|
|||||||
@@ -1,78 +1,15 @@
|
|||||||
{
|
{
|
||||||
"globalExcludes": [
|
"globalExcludes": [
|
||||||
"3dskinlayers",
|
"3dskinlayers",
|
||||||
"ae2-emi-crafting",
|
|
||||||
"AmbientSounds",
|
|
||||||
"amecs",
|
|
||||||
"Animation_Overhaul",
|
|
||||||
"appleskin",
|
|
||||||
"auudio",
|
|
||||||
"axolotlbuckets",
|
|
||||||
"BadOptimizations",
|
|
||||||
"BetterAdvancements",
|
|
||||||
"betterbeds",
|
|
||||||
"BetterThirdPerson",
|
|
||||||
"BHMenu",
|
|
||||||
"blur",
|
|
||||||
"Boat-Item-View",
|
|
||||||
"bobby",
|
|
||||||
"cat_jam",
|
|
||||||
"chat_heads",
|
|
||||||
"chatanimation",
|
|
||||||
"cherishedworlds",
|
|
||||||
"citresewn",
|
"citresewn",
|
||||||
"clickadv",
|
|
||||||
"connector",
|
"connector",
|
||||||
"DisableCustomWorldsAdvice",
|
|
||||||
"drippyloadingscreen",
|
|
||||||
"eating-animation",
|
|
||||||
"emiffect",
|
|
||||||
"emitrades",
|
|
||||||
"entity_model_features",
|
"entity_model_features",
|
||||||
"entity_texture_features",
|
"entity_texture_features",
|
||||||
"entityculling",
|
|
||||||
"euphoriapatcher",
|
"euphoriapatcher",
|
||||||
"fallingleaves",
|
|
||||||
"fancymenu",
|
|
||||||
"fast-ip-ping",
|
|
||||||
"FauxCustomEntityData",
|
|
||||||
"GeckoLibIrisCompat",
|
|
||||||
"gpumemleakfix",
|
|
||||||
"Highlighter",
|
|
||||||
"ImmediatelyFast",
|
|
||||||
"indium",
|
|
||||||
"iris",
|
|
||||||
"iris-flywheel",
|
|
||||||
"ItemBorders",
|
|
||||||
"ItemLocks",
|
|
||||||
"language-reload",
|
|
||||||
"lazy-language-loader",
|
|
||||||
"LegendaryTooltips",
|
|
||||||
"loadmyresources",
|
|
||||||
"lootbeams",
|
|
||||||
"MindfulDarkness",
|
|
||||||
"MouseTweaks",
|
|
||||||
"nicer-skies",
|
|
||||||
"notenoughanimations",
|
"notenoughanimations",
|
||||||
"oculus",
|
"oculus",
|
||||||
"OverflowingBars",
|
|
||||||
"PickUpNotifier",
|
|
||||||
"PresenceFootsteps",
|
|
||||||
"Prism",
|
|
||||||
"reeses_sodium_options",
|
|
||||||
"ResourcePackOverrides",
|
|
||||||
"ryoamiclights",
|
"ryoamiclights",
|
||||||
"Searchables",
|
"yungsmenutweaks"
|
||||||
"seasonhud",
|
|
||||||
"ShoulderSurfing",
|
|
||||||
"skinlayers3d",
|
|
||||||
"sodium",
|
|
||||||
"sorted_enchantments",
|
|
||||||
"visuality",
|
|
||||||
"VR-Combat",
|
|
||||||
"YeetusExperimentus",
|
|
||||||
"yungsmenutweaks",
|
|
||||||
"Zoomify"
|
|
||||||
],
|
],
|
||||||
"globalForceIncludes": [],
|
"globalForceIncludes": [],
|
||||||
"modpacks": {}
|
"modpacks": {}
|
||||||
|
|||||||
@@ -227,12 +227,6 @@ MC_HEALTH_EXTRA_ARGS=(
|
|||||||
--use-server-list-ping
|
--use-server-list-ping
|
||||||
)
|
)
|
||||||
" > /data/.mc-health.env
|
" > /data/.mc-health.env
|
||||||
elif isTrue "$USES_PROXY_PROTOCOL"; then
|
|
||||||
echo "
|
|
||||||
MC_HEALTH_EXTRA_ARGS=(
|
|
||||||
--use-proxy
|
|
||||||
)
|
|
||||||
" > /data/.mc-health.env
|
|
||||||
else
|
else
|
||||||
rm -f /data/.mc-health.env
|
rm -f /data/.mc-health.env
|
||||||
fi
|
fi
|
||||||
|
|||||||
+2
-105
@@ -161,112 +161,9 @@ function normalizeMemSize() {
|
|||||||
echo $((val * scale))
|
echo $((val * scale))
|
||||||
}
|
}
|
||||||
|
|
||||||
function compare_version() {
|
|
||||||
local left_version=$1
|
|
||||||
local comparison=$2
|
|
||||||
local right_version=$3
|
|
||||||
|
|
||||||
if [[ -z "$left_version" ]]; then
|
|
||||||
echo "Left version is required"
|
|
||||||
return 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [[ -z "$right_version" ]]; then
|
|
||||||
echo "Right version is required"
|
|
||||||
return 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Handle version channels ('a', 'b', or numeric)
|
|
||||||
if [[ $left_version == a* || $left_version == b* ]]; then
|
|
||||||
left_version=${left_version:1}
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [[ $right_version == a* || $right_version == b* ]]; then
|
|
||||||
right_version=${right_version:1}
|
|
||||||
fi
|
|
||||||
|
|
||||||
|
|
||||||
local left_version_channel=${left_version:0:1}
|
|
||||||
if [[ $left_version_channel =~ [0-9] ]]; then
|
|
||||||
left_version_channel='r'
|
|
||||||
fi
|
|
||||||
|
|
||||||
local right_version_channel=${right_version:0:1}
|
|
||||||
if [[ $right_version_channel =~ [0-9] ]]; then
|
|
||||||
right_version_channel='r'
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [[ $comparison == "lt" && $left_version_channel < $right_version_channel ]]; then
|
|
||||||
return 0
|
|
||||||
elif [[ $comparison == "lt" && $left_version_channel > $right_version_channel ]]; then
|
|
||||||
return 1
|
|
||||||
elif [[ $comparison == "gt" && $left_version_channel > $right_version_channel ]]; then
|
|
||||||
return 0
|
|
||||||
elif [[ $comparison == "gt" && $left_version_channel < $right_version_channel ]]; then
|
|
||||||
return 1
|
|
||||||
elif [[ $comparison == "le" && $left_version_channel < $right_version_channel ]]; then
|
|
||||||
return 0
|
|
||||||
elif [[ $comparison == "le" && $left_version_channel == $right_version_channel ]]; then
|
|
||||||
return 0
|
|
||||||
elif [[ $comparison == "ge" && $left_version_channel > $right_version_channel ]]; then
|
|
||||||
return 0
|
|
||||||
elif [[ $comparison == "ge" && $left_version_channel == $right_version_channel ]]; then
|
|
||||||
return 0
|
|
||||||
elif [[ $comparison == "eq" && $left_version_channel == $right_version_channel ]]; then
|
|
||||||
return 0
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Compare the versions using sort -V
|
|
||||||
local result
|
|
||||||
|
|
||||||
case $comparison in
|
|
||||||
"lt")
|
|
||||||
if [[ $(echo -e "$left_version\n$right_version" | sort -V | head -n1) == "$left_version" && "$left_version" != "$right_version" ]]; then
|
|
||||||
result=0
|
|
||||||
else
|
|
||||||
result=1
|
|
||||||
fi
|
|
||||||
;;
|
|
||||||
"le")
|
|
||||||
if [[ $(echo -e "$left_version\n$right_version" | sort -V | head -n1) == "$left_version" ]]; then
|
|
||||||
result=0
|
|
||||||
else
|
|
||||||
result=1
|
|
||||||
fi
|
|
||||||
;;
|
|
||||||
"eq")
|
|
||||||
if [[ "$left_version" == "$right_version" ]]; then
|
|
||||||
result=0
|
|
||||||
else
|
|
||||||
result=1
|
|
||||||
fi
|
|
||||||
;;
|
|
||||||
"ge")
|
|
||||||
if [[ $(echo -e "$left_version\n$right_version" | sort -V | tail -n1) == "$left_version" ]]; then
|
|
||||||
result=0
|
|
||||||
else
|
|
||||||
result=1
|
|
||||||
fi
|
|
||||||
;;
|
|
||||||
"gt")
|
|
||||||
if [[ $(echo -e "$left_version\n$right_version" | sort -V | tail -n1) == "$left_version" && "$left_version" != "$right_version" ]]; then
|
|
||||||
result=0
|
|
||||||
else
|
|
||||||
result=1
|
|
||||||
fi
|
|
||||||
;;
|
|
||||||
*)
|
|
||||||
echo "Unsupported comparison operator: $comparison"
|
|
||||||
return 1
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
return $result
|
|
||||||
}
|
|
||||||
|
|
||||||
function versionLessThan() {
|
function versionLessThan() {
|
||||||
# Use if-else since strict mode might be enabled
|
# Use if-else since strict mode might be enabled
|
||||||
if compare_version "${VERSION}" "lt" "${1?}"; then
|
if mc-image-helper compare-versions "${VERSION}" lt "${1?}"; then
|
||||||
return 0
|
return 0
|
||||||
else
|
else
|
||||||
return 1
|
return 1
|
||||||
@@ -445,7 +342,7 @@ function ensureRemoveAllModsOff() {
|
|||||||
reason=${1?}
|
reason=${1?}
|
||||||
|
|
||||||
if isTrue "${REMOVE_OLD_MODS:-false}"; then
|
if isTrue "${REMOVE_OLD_MODS:-false}"; then
|
||||||
log "WARNING using REMOVE_OLD_MODS interferes with $reason -- it is now disabled"
|
log "WARNING using REMOVE_OLDS_MODS interferes with $reason -- it is now disabled"
|
||||||
REMOVE_OLD_MODS=false
|
REMOVE_OLD_MODS=false
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user