Pull images from the Images page #17

Closed
opened 2026-11-30 14:39:42 +00:00 by jfro · 1 comment
Owner

What

  • A "Pull" action on the Images page: enter name[:tag], show layer progress from the pull stream, refresh the list when done.
  • "Pull again / update" on an existing tagged image.
**What** - A "Pull" action on the Images page: enter `name[:tag]`, show layer progress from the pull stream, refresh the list when done. - "Pull again / update" on an existing tagged image.
jfro added this to the v1.0 milestone 2026-11-30 14:47:14 +00:00
Author
Owner

Approach notes (Nye, review; tested on Docker 26 + rootless Podman 5.4.2)

#17 Pull images (Images page)

Reuse: docker.rs client + the Images ResourceList; refresh via the existing watch_resource_events (a pull emits an image pull event) or call the list refresh at stream end.
API: docker.create_image(Some(CreateImageOptionsBuilder::new().from_image(name).tag(tag).build()), None, None) -> stream of CreateImageInfo { id, status, progress_detail{current,total}, .. }. bollard already turns an in-stream errorDetail into Err(DockerStreamError); HTTP errors come back as DockerResponseServerError (404 missing tag/repo, 400 bad ref, 500 registry unreachable). Show message as-is: it is readable ("manifest for alpine:nope-xyz not found", "pull access denied ... may require 'docker login'").
Must-dos:

  1. Always send a tag. With neither a tag in fromImage nor tag, the engine pulls every tag of the repo (documented in bollard-stubs CreateImageOptions). Parse the ref: split tag on the last : only if it comes after the last / (so localhost:5000/foo stays a repo); @sha256: digests go in fromImage with no tag; default latest.
  2. Progress is per layer (id = layer). Keep a map layer -> (current,total), show sum or "n of m layers". Podman sends no current/total (only "Pulling fs layer"/"Download complete") and no final Status: line: show indeterminate progress and treat a clean stream end as success.
  3. Docker's last line says "Downloaded newer image" vs "Image is up to date": nice for the toast on "Pull again".
  4. "Pull again" on an image: use its RepoTags entry (skip <none> / digest-only images, hide the action for them).
  5. One pull at a time per ref; cancel = drop the stream (daemon keeps going, fine). Don't block the UI thread; runs on the tokio rt.
  6. Private registries: out of scope unless trivial; error text already tells the user to docker login. (bollard credentials param exists if wanted later; reading ~/.docker/config.json creds helpers is not trivial.)
  7. Mock: a fake progress sequence for screenshots.
**Approach notes (Nye, review; tested on Docker 26 + rootless Podman 5.4.2)** ## #17 Pull images (Images page) Reuse: `docker.rs` client + the Images ResourceList; refresh via the existing `watch_resource_events` (a pull emits an image `pull` event) or call the list refresh at stream end. API: `docker.create_image(Some(CreateImageOptionsBuilder::new().from_image(name).tag(tag).build()), None, None)` -> stream of `CreateImageInfo { id, status, progress_detail{current,total}, .. }`. bollard already turns an in-stream `errorDetail` into `Err(DockerStreamError)`; HTTP errors come back as `DockerResponseServerError` (404 missing tag/repo, 400 bad ref, 500 registry unreachable). Show `message` as-is: it is readable ("manifest for alpine:nope-xyz not found", "pull access denied ... may require 'docker login'"). Must-dos: 1. **Always send a tag.** With neither a tag in `fromImage` nor `tag`, the engine pulls *every tag* of the repo (documented in bollard-stubs CreateImageOptions). Parse the ref: split tag on the last `:` only if it comes after the last `/` (so `localhost:5000/foo` stays a repo); `@sha256:` digests go in `fromImage` with no tag; default `latest`. 2. Progress is per layer (`id` = layer). Keep a map layer -> (current,total), show sum or "n of m layers". **Podman sends no current/total** (only "Pulling fs layer"/"Download complete") and **no final `Status:` line**: show indeterminate progress and treat a clean stream end as success. 3. Docker's last line says "Downloaded newer image" vs "Image is up to date": nice for the toast on "Pull again". 4. "Pull again" on an image: use its RepoTags entry (skip `<none>` / digest-only images, hide the action for them). 5. One pull at a time per ref; cancel = drop the stream (daemon keeps going, fine). Don't block the UI thread; runs on the tokio rt. 6. Private registries: out of scope unless trivial; error text already tells the user to `docker login`. (bollard `credentials` param exists if wanted later; reading ~/.docker/config.json creds helpers is not trivial.) 7. Mock: a fake progress sequence for screenshots.
jfro closed this issue 2026-11-30 17:41:53 +00:00
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
jfro/krane#17
No description provided.