V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
Recommended Services
Amazon Web Services
LeanCloud
New Relic
ClearDB
kalafinaian
V2EX  ›  云计算

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

  •  
  •   kalafinaian · 78 天前 · 2272 次点击
    这是一个创建于 78 天前的主题,其中的信息可能已经有所发展或是发生改变。

    用 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#
    
    11 条回复    2024-10-11 14:02:50 +08:00
    Kinnice
        1
    Kinnice  
       78 天前
    默认值就是 docker.io
    kalafinaian
        2
    kalafinaian  
    OP
       78 天前
    @Kinnice

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

    那么本地 docker 中存在 kubeflowkatib/suggestion-hyperopt:v0.15.0 (没有 docker.io 前缀) 也可以吗
    Kinnice
        3
    Kinnice  
       78 天前
    @kalafinaian #2 是
    kalafinaian
        4
    kalafinaian  
    OP
       78 天前
    @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
        5
    cheng6563  
       77 天前
    你 k8s 用的是 docker 引擎吗,k8s 很多年前就不是默认使用 docker 了。
    CheckMySoul
        6
    CheckMySoul  
       77 天前
    imagePullPolicy 为 Always 时会先从网络拉取镜像,然后你网络又无法访问 docker.io 。建议改成 IfNotPresent 或者 Never 。
    guanzhangzhang
        7
    guanzhangzhang  
       77 天前
    会先请求 manifest list 和 repo digest ,请求不到就报错拉取失败,设置下拉取策略,生产环境要内网镜像仓库
    litchinn
        8
    litchinn  
       77 天前
    如果是 minukube ,可以用 minikube image load 把镜像加载进去,如果是普通 k8s 集群节点,那么你需要一个 harbor 或者云厂商提供的镜像仓库,然后把镜像推上去
    zaunist
        9
    zaunist  
       77 天前
    6 楼正解,你把 k8s 的镜像拉取策略改一下,改成 ifNotPresent
    kalafinaian
        10
    kalafinaian  
    OP
       77 天前
    @CheckMySoul 感谢
    kalafinaian
        11
    kalafinaian  
    OP
       77 天前
    @Kinnice 对的,可以这样用
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   实用小工具   ·   5317 人在线   最高记录 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 28ms · UTC 07:25 · PVG 15:25 · LAX 23:25 · JFK 02:25
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.