I found the image.proto file of containerd,
https://github.com/containerd/containerd/blob/main/api/services/images/v1/images.proto#L90
I can use the proto file to get a local image,
[root@master-18-86 ~]# ./grpcurl -d '{"name":"DaoCloud.redhat/registry.k8s.io/kube-apiserver:v1.27.5"}' -plaintext -proto image.proto -rpc-header containerd-namespace:k8s.io -unix /run/containerd/containerd.sock containerd.services.images.v1.Images/Get
{
"image": {
"name": "DaoCloud.redhat/registry.k8s.io/kube-apiserver:v1.27.5",
"labels": {
"io.cri-containerd.image": "managed"
},
"target": {
"mediaType": "application/vnd.oci.image.manifest.v1+json",
"digest": "sha256:d7b036dcf284a11517256774c28d073d83617b65bdbbec35fafd29bb51872c7d",
"size": "1960"
},
"createdAt": "2024-04-29T06:53:51.439354485Z",
"updatedAt": "2024-04-29T06:53:51.447932784Z"
}
}
[root@master-18-86 ~]#
but I didn’t know how to use the grpcurl tool to download the image through the proto file,
[root@master-18-86 ~]# ./grpcurl -d '{"image":"DaoCloud.redhat/registry.k8s.io/kube-apiserver:v1.27.5"}' -plaintext -proto image.proto -rpc-header containerd-namespace:k8s.io -unix /run/containerd/containerd.sock containerd.services.images.v1.Images/Create
Error invoking method "containerd.services.images.v1.Images/Create": error getting request data: bad input: expecting start of JSON object: '{' ; instead got DaoCloud.redhat/registry.k8s.io/kube-apiserver:v1.27.5
I want to mirror through proto pull, can anyone help me?
New contributor
xing wu is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.