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
nerdctl pull Specifies the default repository address #2843
Comments
Looking at the codebase, the ref parsing is actually done by containerd. We can see that, in the EnsureImage func, nerdctl makes a call to We can implement this in nerdctl or containerd. The former seems somewhat redundant if we want to be comprehensive, but the latter is probably a lot messier. containerd 2.0 puts all of these functions into its own repository (https://github.com/distribution/reference), and my guess is that nerdctl will support 2.0 ASAP once it releases. So, I think it would be best to add this functionality on nerdctl's side. We can probably add a somewhat simple solution, along the lines of this pseudo-code
I can push out a PR implementing this, but I just want confirmation that this is the direction we want. |
Ideally this should be implemented in https://github.com/containerd/containerd/blob/main/docs/hosts.md |
Sorry, to clarify, are you saying this is already available in containerd? Or are you suggesting this feature should be implemented in the config file in containerd? I was assuming the former but could not get the desired behavior. |
The latter |
Got it, I'll open an issue upstream. Thanks for the clarification! |
Opened an issue in containerd: containerd/containerd#9954. Feel free to add your own thoughts to the issue. As mentioned there, I do need some clarification before I can gauge the effort required, but if so I can attempt to drive the PR. No guarantees yet, however. |
Apologies, been sidetracked by other things to get any headway on this. Taking a step back, I believe the two ideas mentioned here are related but separate. containerd should definitely have something in the hosts file that would ultimately plumb in somewhere here. However, this would not solve the issue in nerdctl, as distribution/reference will still qualify it with a docker prefix here. So, even if I were to make this change, nerdctl would still need additional changes to prepend the desired repo before sending it through ParseDockerRef. This change alone would also solve the immediate issue present here. I'll try to make some time to at least get the latter ask done. This would likely include a new global flag and I'd have to ensure every call to ParseDockerRef gets the specified prefix added, so the initial analysis seems to show that this will take a fair amount of effort. |
@sondavidb IIRC did you try using the mirror mechanism? https://github.com/containerd/containerd/blob/main/docs/hosts.md#setup-a-local-mirror-for-docker I have not used this in a while, but IIRC you can just "point" docker.io to whatever local registry under your control with this. |
What is the problem you're trying to solve
If you want to pull an image, you can specify the default image repository pull in the configuration file
Describe the solution you'd like
The default pull is docker.io. I want to specify the pull address in the configuration file, not on the command line. docker pull can support pulling the image of the specified repository in daemon.json
Additional context
No response
The text was updated successfully, but these errors were encountered: