Repository navigation
Images and volumes: list them, remove the unused ones, update a container onto a newer image, read an image's packages - #31
Merged
Conversation
…iner onto a newer image, read an image's packages Inventory now says which image each container runs and its registry digests, so the panel can tell when the registry has a newer one. New jobs: - docker_resources: images, volumes and build cache, with sizes and the containers using each. - docker_prune: removes images and volumes no container uses (checked here, refused by Docker too) and the build cache. - image_update: pulls a container's image again and recreates it on a newer one with the same settings, networks and volumes (anonymous ones by name), leaving out what only came from the old image. If it doesn't stay up, the old container is put back. - image_packages: an image's OS release and dpkg or apk packages, read through Docker's archive endpoint without running anything inside.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Daemon side of container image updates, image vulnerability scans and Docker cleanup in the panel.
image_idandimage_digests(the registry digests Docker keeps), so the panel can compare against the registry.docker_resources(read-only): images, volumes and build cache from/system/df, with the containers using each.docker_prune: removes images and volumes no container uses (checked against the container list; Docker refuses in-use ones too) and the build cache. Images are untagged first, so a stopped container's image is never forced out.image_update: pulls the container's image again (registry login viaX-Registry-Authwhen given) and, if it's newer, recreates the container with the same config, host config, networks (aliases kept, other networks joined before start) and volumes (anonymous ones carried over by name). Settings that only came from the old image (env, cmd, entrypoint, labels, ports, healthcheck) are left out so the new image's apply. If the new container exits, restarts or turns unhealthy, it's removed and the old one renamed back and started.image_packages(read-only): OS release plus dpkg (including distrolessstatus.d) or apk packages, read through Docker's archive endpoint from an existing container or one created and removed without starting.container.update_imageanddocker.prune, both mutating and confirmed.Tested against real Docker (ignored test
crates/daemon-services/tests/images_live.rs): listing, packages from postgres:16-bookworm (155 packages), an update via a local registry keeping named and anonymous volumes and their data, a rollback when the new image can't start, and a prune that keeps an in-use volume.Written with Claude Code.
🤖 Generated with Claude Code