fix: use rebuild_container instead of docker restart after image pulls

docker restart uses the image ID baked in at container creation — it never
picks up a new digest. rebuild_container reads the stored Unraid XML template,
stops the old container, recreates it with the new image, then handles the
old image cleanup. This is what the Unraid UI 'Apply Update' button does.

docker_update.sh: add rebuild section after pull loop for DAILY containers.
docker_update_remaining.sh: replace retry_docker docker restart with rebuild_container.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Gmer4Lfe
2026-05-31 15:09:55 -04:00
co-authored by Claude Sonnet 4.6
parent 55a38b6b74
commit fdba23c32d
2 changed files with 38 additions and 11 deletions
+7 -8
View File
@@ -278,19 +278,18 @@ if [[ ${#UPDATED[@]} -gt 0 ]]; then
continue
fi
log "$ICON_RUNNING $container is running — restarting on new image..."
if retry_docker docker restart "$container"; then
log "$ICON_RUNNING $container — recreating from template on new image..."
if /usr/local/emhttp/plugins/dynamix.docker.manager/scripts/rebuild_container "$container" >/dev/null 2>&1; then
if verify_running "$container"; then
log "$ICON_DONE $container restarted and running ✅"
log "$ICON_DONE $container recreated and running ✅"
RESTARTED+=("$container")
else
error "$container restarted but crashed immediately"
notify "$container crashed after update-restart on $(hostname)" "Docker Update Remaining" "warning"
RESTART_FAILED+=("$container")
error "$container recreated but not running — may be intentionally stopped"
RESTARTED+=("$container")
fi
else
error "Failed to restart $container after $RETRY_COUNT attempts"
notify "$container failed to restart after update on $(hostname)" "Docker Update Remaining" "warning"
error "Failed to rebuild $container from template"
notify "$container failed to rebuild after update on $(hostname)" "Docker Update Remaining" "warning"
RESTART_FAILED+=("$container")
fi
done