Fix container updates: rebuild on new image, consolidate update scripts

Weekly sync window was pulling images but using docker start after rsync,
which ignores the new digest. Containers in the emby/critical-data profiles
(Emby, Mariadb, Redis) never actually landed on updated images.

docker_update_remaining.sh merged into docker_update.sh --remainder, which
already had better exclusion logic. Added WEEKLY_REMAINING_UPDATES toggle
and WEEKLY_RESTART_CONTAINERS exclusion to remainder mode.

Onboard now runs docker_network_connect.sh on mirror before deploying stacks.
This commit is contained in:
Gmer4Lfe
2026-06-14 10:58:19 -04:00
parent ba3eed39e3
commit fdef61cc25
5 changed files with 92 additions and 349 deletions
+15 -1
View File
@@ -29,6 +29,7 @@
# Targets all currently running containers NOT in:
# DAILY_RESTART_CONTAINERS — already updated daily
# emby + critical-data profiles — updated inline by the weekly sync window
# WEEKLY_RESTART_CONTAINERS — restarted by docker_weekly_restart.sh after sync
# FALLBACK_*_TIER* — owned by the remote server's update cycle
# Pull → compare → prune dangling images.
#
@@ -91,6 +92,9 @@
# Enable or disable normal mode. docker_daily_restart.sh runs regardless.
# (default: true)
#
# WEEKLY_REMAINING_UPDATES
# Enable or disable remainder mode. (default: true)
#
# PROFILE_CRITICAL_CONTAINER_NAMES[emby|critical-data]
# Container names for emby and critical-data profiles — excluded from
# remainder mode (already updated by the weekly sync window)
@@ -163,6 +167,11 @@ detect_hosts
# ━━━ Container Discovery ━━━
# ==============================================================================================
if [[ "$REMAINDER_MODE" == true ]]; then
if [[ "${WEEKLY_REMAINING_UPDATES:-true}" != "true" ]]; then
echo "WEEKLY_REMAINING_UPDATES=false — skipping remainder container updates"
exit 0
fi
declare -A _exclude=()
# Daily containers — updated by docker_update.sh normal mode
@@ -178,6 +187,11 @@ if [[ "$REMAINDER_MODE" == true ]]; then
done
unset _weekly_str _weekly_arr
# Weekly restart containers — restarted by docker_weekly_restart.sh after sync
for _c in "${WEEKLY_RESTART_CONTAINERS[@]}"; do
[[ -n "$_c" ]] && _exclude["$_c"]=1
done
# Fallback coverage containers — owned by the remote server's update cycle.
# This server runs them during fallback but should never update them independently.
# Updating them here risks version divergence: if remote's writeback after handback
@@ -221,7 +235,7 @@ if [[ "$SHOW_STATUS" == true ]]; then
echo "$ICON_HOST Identity: $MY_ID ($LOCAL_SERVER_NAME)"
echo "$ICON_GEAR Mode: $([[ "$REMAINDER_MODE" == true ]] && echo "remainder" || echo "normal (daily)")"
if [[ "$REMAINDER_MODE" == true ]]; then
echo "$ICON_CONTAINERS Containers: ${#TARGET_CONTAINERS[@]} running (excluding daily, weekly sync, and fallback)"
echo "$ICON_CONTAINERS Containers: ${#TARGET_CONTAINERS[@]} running (excluding daily, weekly sync, weekly restart, and fallback)"
for _c in "${TARGET_CONTAINERS[@]}"; do echo " $_c"; done
else
echo "$ICON_CONTAINERS Containers: ${TARGET_CONTAINERS[*]}"