-
Notifications
You must be signed in to change notification settings - Fork 563
FR: Support a WithMirror
option
#1200
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
This issue is stale because it has been open for 90 days with no |
I would like a mirror option as well. |
skaffold uses go-containerregistry, and consequently ignores the many mirrors I have configured. This results in many unnecessary requests upstream, and frequently encountering the Docker Hub pull rate limiter. I would like to see this issue re-opened and mirror support added to go-containerregistry and skaffold. |
Seems simple enough. I agree we should do it. Do we want I also disagree that it should default to mirror.gcr.io, but could be convinced. |
I think it probably makes sense to have I would not hardcode |
Docker configures the mirror at https://docs.docker.com/registry/recipes/mirror/#configure-the-docker-daemon Having |
Do we have any precedent for reading system-wide config files like I think I'm more mixed on Mostly just trying to figure out what parts we find contentious vs. have agreement on. |
Yeah, a Go-level |
Nope: #211
SGTM. There are config files for docker, podman (et al), and containerd that all have slightly different behavior here. We may want to provide something to make it simple to use any of these, kind of like It would be really great if we could have the flexibility or configuration options to allow an "untrusted" mirror to be used only for content-addressable objects and always consult upstream for tags. I think most people want the default of hitting the mirror for tags, too, but I'd love to set a precedent of the option if we can. Do you expect the go-level |
Yeah, I love this.
I think these questions are related, which might have been your point. We could have
...then we could have a method to construct a If you wanted to implement something that only mirrored blobs, you could have |
Do you think that it makes sense to have a kind of mapping between original registries and mirror registries? e.g.) |
For informational purposes, I'll describe my team's configuration. We're using Consequently, in my configuration All of the registries are configured in the @ingwonsong Docker Registry Instances
Docker Configuration
k3d-config.yaml Configuration
|
What do you think about More generally, if we have a list of mirrors: Try WDYT? |
On the other hand, I suspect that such |
This is basically a requirement. Mirrors are allowed to return 404 etc if an image isn't mirrored, which signals to the client that it should go to the original registry. You can simulate this by setting the mirror to a fake server or a non-mirror registry, where the requested image won't exist. You'll just always try the mirror and fallback to the original registry when it fails. |
Hey guys, coming from the Skaffold issue thread. I see this issue has been noted as "good first issue". I have been digging into this issue as we are getting rate limited because of the requests going to docker rather than the mirrors I specify in my daemon. This is the first time I really dive deep into Go code, but I ended up at the |
As a quick PoC, I made some small modifications to the NewRegistry function and hard coded a registry mirror I'm using. I also needed to change I then pointed skaffold at my local version of this repo and I was able to pull images using the mirror, whilst using the release version of skaffold produced rate limits 😉 |
Hey thanks for digging into this! I had been imagining this as an option on methods in
(based lightly on the design outlined in #1200 (comment)) The reason being that lots of other things in go-containerregistry deal with If you want to arrange a time to join a video chat and talk through this, maybe write some code together, that would be great. I'm especially free Fridays, including tomorrow. |
Sounds good! 😄 Let's discuss a time for a call about this, I'll drop you a msg on your Twitter 😄 Thx again for your help! |
was there any progress regarding this issue? |
Nope, not really. I think we'd still like this, and if anybody's interested in discussing it more I'd be happy to help. |
we also need this as it's blocking GoogleContainerTools/skaffold#7368 |
So my suggestion to avoid reinventing the wheel would be to copy how containerd has implemented mirror configuration. It seems to cover the majority of use cases without being overly verbose. Has there been any consensus on how this would be implemented. Otherwise I would be interested in implementing support for a containerd like mirror configuration. The reason I think that a file based configuration approach would be good is because it would allow other projects to support it without too much configuration. |
What would be better? Supporting multiple mirrors, or just one, which gets created from an environmental variable or a file as @phillebaba suggests with the containerd approach? I think there is some sort of design mentioned in the comment above, but would be interested in joining you guys to discuss how one would approach this as I would like to make a change to skaffold so it can make use of whatever change is made here. |
My personal opinion regarding this is that if you enable the simple use case you are immediately going to get request for the advanced use case. Containerd has gone through a couple of iterations for this design, which itself is partially based on what docker has done. A benefit is the fact that with the Containerd configuration it is possible to configure headers, CA certs, and multiple mirros in a specific order. |
Hi folks, |
This is definitely a needed feature! It is way too easy to hit a pull limit using tools like I think previous discussion got mired down into multiple mirrors, mirror ordering, etc. At least in my use case, a single local mirror that caches upstream objects is desired. If that could be possible, it would go a long way to cutting down on network and pull request budgets. |
Another vote for this feature! |
Given the news that Docker Hub is enforcing stricter rate limits (10 pulls/hour/IP for unauthenticated users starting March 1), I wanted to check if this issue has been reprioritized. Tools like Skaffold continue to hit these limits because go-containerregistry lacks proper support for registry mirrors. The inability to respect daemon-configured mirrors is a major blocker for many teams relying on cached artifacts to avoid unnecessary Docker Hub throttling. I saw that PR #2010 is open as a POC for WithMirror support. Could we get an update on its status? Is there a roadmap for integrating this into a future release? Thanks for all the work on this! |
... and default it to
mirror.gcr.io
😎The text was updated successfully, but these errors were encountered: