Pull images from the Images page #17
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
What
name[:tag], show layer progress from the pull stream, refresh the list when done.Approach notes (Nye, review; tested on Docker 26 + rootless Podman 5.4.2)
#17 Pull images (Images page)
Reuse:
docker.rsclient + the Images ResourceList; refresh via the existingwatch_resource_events(a pull emits an imagepullevent) or call the list refresh at stream end.API:
docker.create_image(Some(CreateImageOptionsBuilder::new().from_image(name).tag(tag).build()), None, None)-> stream ofCreateImageInfo { id, status, progress_detail{current,total}, .. }. bollard already turns an in-streamerrorDetailintoErr(DockerStreamError); HTTP errors come back asDockerResponseServerError(404 missing tag/repo, 400 bad ref, 500 registry unreachable). Showmessageas-is: it is readable ("manifest for alpine:nope-xyz not found", "pull access denied ... may require 'docker login'").Must-dos:
fromImagenortag, 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/(solocalhost:5000/foostays a repo);@sha256:digests go infromImagewith no tag; defaultlatest.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 finalStatus:line: show indeterminate progress and treat a clean stream end as success.<none>/ digest-only images, hide the action for them).docker login. (bollardcredentialsparam exists if wanted later; reading ~/.docker/config.json creds helpers is not trivial.)