Skip to content

Images and volumes: list them, remove the unused ones, update a container onto a newer image, read an image's packages - #31

Merged
liamdevss merged 1 commit into
mainfrom
image-updates
Nov 21, 2026
Merged

liamdevss merged 1 commit into
mainfrom
image-updates

Conversation

@liamdevss

Copy link
Copy Markdown
Contributor

Daemon side of container image updates, image vulnerability scans and Docker cleanup in the panel.

  • Inventory: each container's image_id and image_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 via X-Registry-Auth when 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 distroless status.d) or apk packages, read through Docker's archive endpoint from an existing container or one created and removed without starting.
  • New capability ops container.update_image and docker.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

…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.
@liamdevss
liamdevss requested a review from a team as a code owner November 21, 2026 02:13
@liamdevss
liamdevss merged commit bb868ce into main Nov 21, 2026
12 checks passed
@liamdevss
liamdevss deleted the image-updates branch November 21, 2026 02:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant