我加载了一个docker映像到我的K3集群,如下所示:
# ctr -n k8s.io -a /run/k3s/containerd/containerd.sock image import /home/rocky/myawx-v1.0.0.tar
(实际上我已经尝试了许多不同版本的上述命令)
我可以看到这里的图像:
# k3s ctr image ls | grep awx
docker.io/library/myawx:v1.0.0 application/vnd.docker.distribution.manifest.v2+json sha256:7...9 617.3 MiB linux/amd64 io.cri-containerd.image=managed
quay.io/ansible/awx-ee:latest application/vnd.docker.distribution.manifest.v2+json sha256:5...0 613.4 MiB linux/amd64 io.cri-containerd.image=managed
quay.io/ansible/awx-ee@sha256:5...0 application/vnd.docker.distribution.manifest.v2+json sha256:5...0 613.4 MiB linux/amd64 io.cri-containerd.image=managed```
但是如果我试着拉图像,我得到这个错误:
# k3s ctr image pull docker.io/library/myawx:v1.0.0
docker.io/library/myawx:v1.0.0: resolving |--------------------------------------|
elapsed: 0.5 s total: 0.0 B (0.0 B/s)
INFO[0000] trying next host error="pull access denied, repository does not exist or may require authorization: server message:
insufficient_scope: authorization failed" host=registry-1.docker.io
ctr: failed to resolve reference "docker.io/library/myawx:v1.0.0": pull access denied,
repository does not exist or may require authorization: server message:
insufficient_scope: authorization failed
如果我试图运行图像,我得到这个…
# k3s ctr run docker.io/library/myawx myawx-run
ctr: image "docker.io/library/myawx": not found
我不知道我在做什么,我只是在抓稻草。请帮助!
k3s ctr image ls | grep awx
只是告诉您图像是在本地加载的(而不是加载到注册表中)。在下一个命令中,当您执行k3s ctr image pull..
或k3s ctr image run
时,您实际上期望从远程注册表中拉下映像。你想从哪个注册表中提取这个?
docker.io/library/myawx:v1.0.0
对我来说,它看起来像要到docker注册表,而不是您想要的注册表。