Repository navigation
Mirror container images with proxy mirror - #438
Draft
pinguinfuss wants to merge 3 commits into
Draft
pinguinfuss wants to merge 3 commits into
pinguinfuss wants to merge 3 commits into
Conversation
… header: a digest names one document, and a tag is shared by all clients that accept an index type, so Docker, containerd and Podman read the same entry and a pre-fetched image is found offline. Clients without index support keep their per-Accept entry, and the old keys are still written and read as fallback.
…o it follows OCI Bearer challenges, uses configured upstream credentials and the SSRF guard, and artifact downloads have no overall time limit. Before this the CLI used a plain client and Docker Hub answered every request with 401.
…kg:docker and pkg:oci PURLs: the mirror walks index, platform manifests (with their attestations) and blobs through the container handler, so a later pull is served from cache even when the upstream is down. A --platform filter (platforms in the API) limits multi-arch images, repository_url only resolves to configured registries, and names, tags and digests are validated before anything is fetched.
pinguinfuss
marked this pull request as draft
October 11, 2026 22:39
Contributor
Author
|
@andrew For #412 I'd change |
andrew
requested changes
Oct 12, 2026
andrew
left a comment
Contributor
There was a problem hiding this comment.
Two reproduced failures need fixing before merge:
internal/handler/container_mirror.go:216: Mirroring updates the cached tag before fetching its layers. Starting with a fully mirrored tag, then moving that tag to an image with an unavailable layer, makes the mirror fail but leaves the tag pointing at the incomplete image. Publish the tag only after all selected manifests and blobs are cached, preserving the previous tag on failure. Please include that part of the proposed change in this PR and add a regression test.internal/handler/container_manifest.go:194-198: An incompatible shared entry prevents lookup of compatible per-Accept entries. Caching a Docker manifest list, then an OCI index for the same tag, then taking the upstream offline makes a Docker-only Accept request return 503 despite its cached representation still being available. Continue to the fallback keys when the shared entry is incompatible, and add a regression test.
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.
Closes #411.
proxy mirrornow pre-fetchespkg:dockerandpkg:ociimages: index, platform manifests (with their attestations) and blobs, stored under the keys a pull reads. A later pull is served from cache even when the upstream is down.proxy mirroruses the same upstream clients asserve. Before, Docker Hub answered every request with 401.--platform(orplatformsin the API) limits multi-arch images.repository_urlonly resolves to configured registries.Tested offline against Docker Hub and ghcr.io with containerd and Docker.
Open question: Docker 29 also requests
sha256-<digest>tags on every pull. Offline the proxy answers those with 502 and the pull fails, on main too. Returning 404 there fixes it. Should that go in here or in its own PR?