Fix formatting in CleanupDocker.php for docker command

Previously, the image prune command used {{{{index .Config.Labels "coolify.managed"}}}},
which produces 4 literal braces and causes a Go template parsing error. As a result,
all images were deleted regardless of the label.

This commit fixes the command to use {{index .Config.Labels "coolify.managed"}}, so
images with the label coolify.managed=true are preserved during cleanup.
This commit is contained in:
Dion VH 2026-03-09 15:27:37 +01:00 committed by GitHub
parent e1f940dc22
commit 9e4cd96187
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -127,7 +127,7 @@ class CleanupDocker
$commands[] = "docker images --format '{{.Repository}}:{{.Tag}}' | ".
$grepCommands.' | '.
"xargs -r -I {} sh -c 'docker inspect --format \"{{{{index .Config.Labels \\\"coolify.managed\\\"}}}}\" \"{}\" 2>/dev/null | grep -q true || docker rmi \"{}\" 2>/dev/null' || true";
"xargs -r -I {} sh -c 'docker inspect --format \"{{index .Config.Labels \\\"coolify.managed\\\"}}\" \"{}\" 2>/dev/null | grep -q true || docker rmi \"{}\" 2>/dev/null' || true";
return implode(' && ', $commands);
}