V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
V2EX 提问指南
fuge
V2EX  ›  问与答

一台新的 centos7 主机,用官方的方法安装完 docker 最新的版本,一运行就报错。网上所有的方法基本都试过了,折腾了一天,还是不能解决,不知道有没有人遇到过。

  •  
  •   fuge · 2022-06-17 15:48:56 +08:00 · 1350 次点击
    这是一个创建于 676 天前的主题,其中的信息可能已经有所发展或是发生改变。
    安装过程
    proxychains4 yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
    proxychains4 yum install docker-ce docker-ce-cli containerd.io docker-compose-plugin

    运行报错
    docker run sentry

    Unable to find image 'sentry:latest' locally

    docker: Error response from daemon: Get "https://registry-1.docker.io/v2/": x509 : certificate is not valid for any names, but wanted to match registry-1.docker.
    第 1 条附言  ·  2022-06-17 17:22:03 +08:00
    我不用代理,直接换清华的 yum 源会报错。。
    https://mirrors.tuna.tsinghua.edu.cn/centos/7/os/x86_64/repodata/repomd.xml: [Errno 14] curl#60 - "Peer's Certificate issuer is not recognized."
    第 2 条附言  ·  2022-06-24 08:22:00 +08:00
    结案了
    是我网络的问题,换到另外一个网络就完全没有问题了。
    21 条回复    2022-06-18 01:47:44 +08:00
    jifengg
        1
    jifengg  
       2022-06-17 16:38:20 +08:00
    看提示,是证书校验不通过,你先试试这台机器上跑
    curl https://registry-1.docker.io/v2/
    看看是否有相关错误
    hefish
        2
    hefish  
       2022-06-17 16:42:28 +08:00
    不能直接访问公网啊,还要挂 socks 才行吗?
    fuge
        3
    fuge  
    OP
       2022-06-17 16:46:18 +08:00
    @jifengg 感谢回复,报如下的错误。

    curl https://registry-1.docker.io/v2/

    curl: (60) Peer's Certificate issuer is not recognized.
    More details here: http://curl.haxx.se/docs/sslcerts.html

    curl performs SSL certificate verification by default, using a "bundle"
    of Certificate Authority (CA) public keys (CA certs). If the default
    bundle file isn't adequate, you can specify an alternate file
    using the --cacert option.
    If this HTTPS server uses a certificate signed by a CA represented in
    the bundle, the certificate verification probably failed due to a
    problem with the certificate (it might be expired, or the name might
    not match the domain name in the URL).
    If you'd like to turn off curl's verification of the certificate, use
    the -k (or --insecure) option.

    在浏览器打开 https://registry-1.docker.io/v2/
    显示的内容是
    {"errors":[{"code":"UNAUTHORIZED","message":"authentication required","detail":null}]}
    fuge
        4
    fuge  
    OP
       2022-06-17 16:47:42 +08:00
    @hefish 用的是国外的源,所有挂代理,不挂代理安装不来。
    hertzry
        5
    hertzry  
       2022-06-17 16:48:10 +08:00 via Android
    不能用代理。
    hertzry
        6
    hertzry  
       2022-06-17 16:49:51 +08:00 via Android
    建议你手动下载镜像,然后 docker load 。
    fuge
        7
    fuge  
    OP
       2022-06-17 16:50:39 +08:00
    @hertzry 是最近不能用的吗,因为我之前几台机器都是这样安装的,没有问题的。
    fuge
        8
    fuge  
    OP
       2022-06-17 16:51:49 +08:00
    @hertzry load 以后,run 会报一样的错误。
    bomb77
        9
    bomb77  
       2022-06-17 16:53:00 +08:00
    配置个国内 docker 源镜像试下,别走代理,比如用 daocloud 的 https://www.daocloud.io/mirror
    my3157
        10
    my3157  
       2022-06-17 16:55:05 +08:00
    my3157
        11
    my3157  
       2022-06-17 16:55:45 +08:00
    看错问题了 :dog:
    wccc
        12
    wccc  
       2022-06-17 17:05:37 +08:00
    yum update ca 更新下?
    hertzry
        13
    hertzry  
       2022-06-17 17:11:13 +08:00 via Android
    你从别的机器上 docker save 这个镜像,再 docker load 试试?
    hertzry
        14
    hertzry  
       2022-06-17 17:12:25 +08:00 via Android
    应该是这个镜像还需要下载别的东西。
    hertzry
        15
    hertzry  
       2022-06-17 17:14:30 +08:00 via Android
    换一个别的代理,这个代理证书不行。我之前用公用的代理也是这个错误,换了自己的代理就好了。
    xtinput
        16
    xtinput  
       2022-06-17 17:14:54 +08:00
    centos 不是不维护了吗?
    fuge
        17
    fuge  
    OP
       2022-06-17 17:17:42 +08:00
    @hertzry 这个就是我自动的代理,bandwagon 的。。。。
    fuge
        18
    fuge  
    OP
       2022-06-17 17:18:01 +08:00
    @xtinput 内网用,不碍事。
    fuge
        19
    fuge  
    OP
       2022-06-17 17:18:38 +08:00
    @my3157 没有,谢谢回复,您提供的连接很有帮助。
    oott123
        20
    oott123  
       2022-06-17 21:06:19 +08:00
    yum install ca-certificates
    emptystring
        21
    emptystring  
       2022-06-18 01:47:44 +08:00 via Android
    网络环境配置有问题。
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   1109 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 27ms · UTC 22:40 · PVG 06:40 · LAX 15:40 · JFK 18:40
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.