April 20Apr 20 I am having problems with the removal of orphan images, during the docker updating process, since some weeks ago. Asking help to AI (Claude), this is the answered we arrive after some days and trials:Please, take as it is, I am zero in linux computing:Descripción:When updating multiple containers at once ("Update All"), the update_container script fails to clean up orphaned images because $oldImageID is always empty.Root cause:In update_container, $oldImageID is obtained by calling getImageID($Repository) which searches images by tag. When processing multiple containers in the same PHP process (passed as *-separated arguments), by the time the second container is processed, Docker has already reassigned the :latest tag to the newly pulled image from the first iteration. The old image is now dangling (no tag), so getImageID() returns null and the cleanup step is skipped.Affected file: /usr/local/emhttp/plugins/dynamix.docker.manager/scripts/update_containerProposed fix: Obtain $oldImageID directly from the running container's image reference before pulling, instead of searching by tag:php$oldContainerDetails = $DockerClient->getContainerDetails($Name); $oldImageRaw = $oldContainerDetails['Image'] ?? ''; $oldImageID = strpos($oldImageRaw, 'sha256:') === 0 ? substr($oldImageRaw, 7, 12) : null; if (!$oldImageID) $oldImageID = $DockerClient->getImageID($Repository);Reproduced on: Unraid 7.2.4, Docker 27.5.1 Edited April 20Apr 20 by dellorianes
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.