Skip to content

add --registry-mirror support for Containerd Runtime #18361

Open
@medyagh

Description

we have support for registry-mirror for docker runtime but not for containerd:

I did this

$ minikube start --container-runtime=containerd --registry-mirror=http://localhost:5000

and then
$ minikube ssh
$ docker@minikube:~$ ls /etc/containerd/certs.d/
docker.io

According to Gemini to add registry mirror to containerd,


Locate the containerd Config File:
This is usually found at /etc/containerd/config.toml. If it doesn't exist, you'll need to create it.

Modify/Add the plugins."io.containerd.grpc.v1.cri".registry Section:

Version 1.6 and newer:
Make sure this section has plugins."io.containerd.grpc.v1.cri".registry.config_path = "/etc/containerd/certs.d" set.
Create a hosts.toml file within /etc/containerd/certs.d/registry-to-mirror.com, replacing 'registry-to-mirror.com' with the actual registry hostname you want to mirror (e.g., docker.io).
Ini, TOML
server = "https://registry-1.docker.io"  # Original registry (if needed)

[host."https://my-local-mirror.com"]
capabilities = ["pull", "resolve"] 
Use code [with caution.](https://gemini.google.com/faq#coding)


In the code I see we only Start the Docker Container runtime in the provisioner with the registry mirror:
https://github.com/medyagh/minikube/blob/375d9c6cbf6d33a1c20d91c886f7f19c5d8b52c2/pkg/provision/ubuntu.go#L111

Metadata

Assignees

Labels

help wantedDenotes an issue that needs help from a contributor. Must meet "help wanted" guidelines.kind/featureCategorizes issue or PR as related to a new feature.priority/important-soonMust be staffed and worked on either currently, or very soon, ideally in time for the next release.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions