Docker 镜像重命名 不能加"docker.io"这个字符串吗

111 天前
 kalafinaian

用 docker tag 重新命名,新名字中"docker.io"字符串消失了

root@ubuntu-Standard-PC-Q35-ICH9-2009:~/docker# docker images | grep katib
kubeflowkatib/suggestion-goptuna                               latest                          43cc63bf9b79   2 weeks ago     45.8MB
kubeflowkatib/tfevent-metrics-collector                        latest                          d4c69f6016a5   2 weeks ago     2.14GB
kubeflowkatib/suggestion-optuna                                latest                          1727e84b8189   2 weeks ago     268MB
kubeflowkatib/file-metrics-collector                           latest                          ad0404bbec45   2 weeks ago     32.4MB
kubeflowkatib/suggestion-hyperopt                              latest                          a05b0ad35155   2 weeks ago     490MB
root@ubuntu-Standard-PC-Q35-ICH9-2009:~/docker#
root@ubuntu-Standard-PC-Q35-ICH9-2009:~/docker# docker tag  kubeflowkatib/suggestion-hyperopt:latest   docker.io/kubeflowkatib/suggestion-hyperopt:v0.15.0
root@ubuntu-Standard-PC-Q35-ICH9-2009:~/docker# docker images | grep katib
kubeflowkatib/suggestion-goptuna                               latest                          43cc63bf9b79   2 weeks ago     45.8MB
kubeflowkatib/tfevent-metrics-collector                        latest                          d4c69f6016a5   2 weeks ago     2.14GB
kubeflowkatib/suggestion-optuna                                latest                          1727e84b8189   2 weeks ago     268MB
kubeflowkatib/file-metrics-collector                           latest                          ad0404bbec45   2 weeks ago     32.4MB
kubeflowkatib/suggestion-hyperopt                              latest                          a05b0ad35155   2 weeks ago     490MB
kubeflowkatib/suggestion-hyperopt                              v0.15.0                         a05b0ad35155   2 weeks ago     490MB
root@ubuntu-Standard-PC-Q35-ICH9-2009:~/docker#
2328 次点击
所在节点    云计算
11 条回复
Kinnice
111 天前
默认值就是 docker.io
kalafinaian
111 天前
@Kinnice

现在是这样,K8S 启动一个 pod 需要拉 docker.io/kubeflowkatib/suggestion-hyperopt:v0.15.0

那么本地 docker 中存在 kubeflowkatib/suggestion-hyperopt:v0.15.0 (没有 docker.io 前缀) 也可以吗
Kinnice
111 天前
@kalafinaian #2 是
kalafinaian
111 天前
@Kinnice


奇怪了,现在本地 docker 有 kubeflowkatib/suggestion-hyperopt:v0.15.0 ,但启动的 pod 里显示拉取 docker.io/kubeflowkatib/suggestion-hyperopt:v0.15.0 失败


Tolerations: node.kubernetes.io/not-ready:NoExecute op=Exists for 300s
node.kubernetes.io/unreachable:NoExecute op=Exists for 300s
Events:
Type Reason Age From Message
---- ------ ---- ---- -------
Normal Scheduled 2m17s default-scheduler Successfully assigned kubeflow/tune-experiment-random-6b69cc8b67-pnvbp to szl-dev-k8s-node4
Warning Failed 103s kubelet Failed to pull image "docker.io/kubeflowkatib/suggestion-hyperopt:v0.15.0": rpc error: code = Unknown desc = Error response from daemon: Get "https://registry-1.docker.io/v2/": dial tcp: lookup registry-1.docker.io on 223.5.5.5:53: read udp 172.27.12.232:1179->223.5.5.5:53: i/o timeout
Warning Failed 72s kubelet Failed to pull image "docker.io/kubeflowkatib/suggestion-hyperopt:v0.15.0": rpc error: code = Unknown desc = Error response from daemon: Get "https://registry-1.docker.io/v2/": dial tcp: lookup registry-1.docker.io on 223.5.5.5:53: read udp 172.27.12.232:47682->223.5.5.5:53: i/o timeout
Normal Pulling 46s (x3 over 2m17s) kubelet Pulling image "docker.io/kubeflowkatib/suggestion-hyperopt:v0.15.0"
Warning Failed 26s (x3 over 103s) kubelet Error: ErrImagePull
Warning Failed 26s kubelet Failed to pull image "docker.io/kubeflowkatib/suggestion-hyperopt:v0.15.0": rpc error: code = Unknown desc = Error response from daemon: Get "https://registry-1.docker.io/v2/": dial tcp: lookup registry-1.docker.io on 223.5.5.5:53: read udp 172.27.12.232:43115->223.5.5.5:53: i/o timeout
Normal BackOff 0s (x4 over 103s) kubelet Back-off pulling image "docker.io/kubeflowkatib/suggestion-hyperopt:v0.15.0"
Warning Failed 0s (x4 over 103s) kubelet Error: ImagePullBackOff
root@ubuntu-Standard-PC-Q35-ICH9-2009:~/docker#
root@ubuntu-Standard-PC-Q35-ICH9-2009:~/docker# docker images | grep katib
kubeflowkatib/suggestion-goptuna latest 43cc63bf9b79 2 weeks ago 45.8MB
kubeflowkatib/tfevent-metrics-collector latest d4c69f6016a5 2 weeks ago 2.14GB
kubeflowkatib/suggestion-optuna latest 1727e84b8189 2 weeks ago 268MB
kubeflowkatib/file-metrics-collector latest ad0404bbec45 2 weeks ago 32.4MB
kubeflowkatib/suggestion-hyperopt latest a05b0ad35155 2 weeks ago 490MB
kubeflowkatib/suggestion-hyperopt v0.15.0 a05b0ad35155 2 weeks ago 490MB
root@ubuntu-Standard-PC-Q35-ICH9-2009:~/docker#
cheng6563
111 天前
你 k8s 用的是 docker 引擎吗,k8s 很多年前就不是默认使用 docker 了。
CheckMySoul
111 天前
imagePullPolicy 为 Always 时会先从网络拉取镜像,然后你网络又无法访问 docker.io 。建议改成 IfNotPresent 或者 Never 。
guanzhangzhang
111 天前
会先请求 manifest list 和 repo digest ,请求不到就报错拉取失败,设置下拉取策略,生产环境要内网镜像仓库
litchinn
111 天前
如果是 minukube ,可以用 minikube image load 把镜像加载进去,如果是普通 k8s 集群节点,那么你需要一个 harbor 或者云厂商提供的镜像仓库,然后把镜像推上去
zaunist
111 天前
6 楼正解,你把 k8s 的镜像拉取策略改一下,改成 ifNotPresent
kalafinaian
111 天前
@CheckMySoul 感谢
kalafinaian
111 天前
@Kinnice 对的,可以这样用

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/1078874

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX