Configure containerd Image Repository
To set up the image repository for containerd, you will need to edit the configuration file of containerd.
- Open the configuration file for containerd, usually located in /etc/containerd/config.toml.
- Locate the [plugins] section in the configuration file, and if it doesn’t exist, add the following content:
[plugins]
[plugins."io.containerd.grpc.v1.cri"]
[plugins."io.containerd.grpc.v1.cri".registry]
- [plugins.”io.containerd.grpc.v1.cri”.registry] – There is no other option for running the containerd plugin.
[plugins."io.containerd.grpc.v1.cri".registry.mirrors]
[plugins."io.containerd.grpc.v1.cri".registry.mirrors."mirror-name"]
endpoint = ["https://mirror.example.com"]
Replace mirror-name with the name of the mirror repository you prefer, and replace https://mirror.example.com with the actual address of the mirror repository.
- Save and close the configuration file.
- Restart the containerd service for the configuration changes to take effect.
You have successfully configured the image repository for containerd. Now, when you pull images using containerd, it will attempt to retrieve images from the configured image repository.