如何使用containerd从私有存储库中提取图像?

dev*_*min 7 containerd containerdctl

如何使用containerd从私有存储库中提取图像?

我使用下面的 containerd 命令从私有存储库中提取图像,但失败并显示以下错误消息。

sudo crictl pull qtech/graphql:latest

FATA[0002] pulling image: rpc error: code = Unknown desc = failed to pull and unpack image "docker.io/qtech/graphql:latest": failed to resolve reference "docker.io/qtech/graphql:latest": pull access denied, repository does not exist or may require authorization: server message: insufficient_scope: authorization failed

Run Code Online (Sandbox Code Playgroud)

我确实使用我的 docker 凭据登录并成功提取了相同的图像。

azureuser@zk-master:~$ sudo docker login
Login with your Docker ID to push and pull images from Docker Hub. If you don't have a Docker ID, head over to https://hub.docker.com to create one.
Username: qtech
Password: 
WARNING! Your password will be stored unencrypted in /root/.docker/config.json.
Configure a credential helper to remove this warning. See
https://docs.docker.com/engine/reference/commandline/login/#credentials-store

Login Succeeded


azureuser@zk-master:~$ sudo docker pull qtech/graphql:latest
latest: Pulling from qtech/graphql
40e059520d19: Pull complete 
e640ca4424de: Pull complete 
3ee146eff338: Pull complete 
7a51ccd0399b: Pull complete 
c49798e0169e: Pull complete 
519f1a159b82: Pull complete 
6200637fe07c: Pull complete 
5789d71f6f43: Pull complete 
Digest: sha256:186ba59f4d3ccb03fd84888fc33aa12a8854f23e566c6e5a870ef7a43c3fb1f1
Status: Downloaded newer image for qtech/graphql:latest
docker.io/qtech/graphql:latest
azureuser@zk-master:~$

Run Code Online (Sandbox Code Playgroud)

但 Containerd 似乎在运行时没有获取这些凭据。

那么如何使用containerd从私有存储库中提取镜像呢?

Ahm*_*d S 5

这对我有用:

crictl pull --creds "用户名:密码" "来自私有注册表的图像详细信息@SHA 详细信息"