Skip to content
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

how to set a mirror for docker.io #663

Open
djbobyd opened this issue Nov 24, 2024 · 3 comments
Open

how to set a mirror for docker.io #663

djbobyd opened this issue Nov 24, 2024 · 3 comments

Comments

@djbobyd
Copy link

djbobyd commented Nov 24, 2024

Hello,

Since docker.io has a very restrictive limit for image download I would like to configure my mirror server to be used for downloading iamges from docker.io
I tried to configure it in the containerd config.toml as some descriptions in internet suggested (https://github.com/containerd/containerd/blob/main/docs/cri/registry.md, ) but it didn't work. I then tried to configure it through the registries.yaml of the k3s which was another documented method (https://docs.k3s.io/installation/private-registry) , but again no luck.
Please tell me what is the appropriate method to use a docker.io mirror (mine is insecure so such a configuration would be most useful).

Thanks!

@eball
Copy link
Collaborator

eball commented Nov 25, 2024

Hi @djbobyd

For containerd, if you want to add a docker registry mirror, only one thing you should do is add a configuration to the containerd config file in the /etc/containerd/config.toml. And the configuration section likes this

[plugins."io.containerd.grpc.v1.cri".registry.mirrors]
     [plugins."io.containerd.grpc.v1.cri".registry.mirrors."docker.io"]
          endpoint = ["https://your-mirrors.example.com","https://registry-1.docker.io"]

For K3S, you can add a config file to /etc/rancher/k3s, named registries.yaml. And put the configuration

mirrors:
  docker.io:
    endpoint:
      - "https://your-mirror.example.com"

@djbobyd
Copy link
Author

djbobyd commented Nov 26, 2024

Hi,
that is what I did, but it doesn't seem to be working. I guess I will double check and look for more suggestions over the internet

@eball
Copy link
Collaborator

eball commented Nov 26, 2024

Can you provide some failure examples or logs by kubectl describe pods <your-pod> -n <pod-namespace>?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants