Show a launched job's progress, stop a refused rerun from overwriting the live record, and label deployed containers so Unraid owns them

This commit is contained in:
Gmer4Lfe
2026-08-17 04:26:32 -04:00
parent cce1e25c2b
commit 2cbc06a683
5 changed files with 152 additions and 6 deletions
+16 -1
View File
@@ -279,7 +279,10 @@ deploy_container_from_xml() {
[[ "$_transformed_xml" != "$xml_file" ]] && _gpu_tmp="$_transformed_xml"
xml_file="$_transformed_xml"
local name repo network extra privileged
local name repo network extra privileged webui icon
# WebUI and Icon become Unraid labels below — see the docker create line for why.
webui=$( awk 'match($0,/<WebUI>([^<]*)<\/WebUI>/, a){print a[1];exit}' "$xml_file")
icon=$( awk 'match($0,/<Icon>([^<]*)<\/Icon>/, a){print a[1];exit}' "$xml_file")
name=$( awk 'match($0,/<Name>([^<]+)<\/Name>/, a){print a[1];exit}' "$xml_file")
repo=$( awk 'match($0,/<Repository>([^<]+)<\/Repository>/,a){print a[1];exit}' "$xml_file")
network=$( awk 'match($0,/<Network>([^<]+)<\/Network>/, a){print a[1];exit}' "$xml_file")
@@ -318,7 +321,19 @@ deploy_container_from_xml() {
printf "docker stop %q 2>/dev/null || true\n" "$name"
printf "docker rm %q 2>/dev/null || true\n" "$name"
echo ""
# Unraid's Docker Manager decides what it owns by label, not by template presence. The
# XML is SCPed to the mirror's templates-user above, but without these three the WebGUI
# lists the container as third-party: no Edit button, no WebUI link, no icon — the
# operator can see it running and cannot do anything with it.
#
# The values go in verbatim, placeholders and all: Unraid stores the literal
# "http://[IP]:[PORT:8989]/..." form in the label and substitutes at render time, so
# resolving them here would produce a link that stops being right the moment the
# container's port mapping changes.
printf "docker create --name %q --restart=unless-stopped" "$name"
printf " --label %q" "net.unraid.docker.managed=dockerman"
[[ -n "$webui" ]] && printf " --label %q" "net.unraid.docker.webui=${webui}"
[[ -n "$icon" ]] && printf " --label %q" "net.unraid.docker.icon=${icon}"
[[ -n "$network" ]] && printf " --network=%q" "$network"
[[ "$privileged" == "true" ]] && printf " --privileged"
[[ -n "$extra" ]] && printf " %s" "$extra"