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

2022-06-17 15:48:56 +08:00
 fuge
安装过程
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.
1365 次点击
所在节点    问与答
21 条回复
jifengg
2022-06-17 16:38:20 +08:00
看提示,是证书校验不通过,你先试试这台机器上跑
curl https://registry-1.docker.io/v2/
看看是否有相关错误
hefish
2022-06-17 16:42:28 +08:00
不能直接访问公网啊,还要挂 socks 才行吗?
fuge
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
2022-06-17 16:47:42 +08:00
@hefish 用的是国外的源,所有挂代理,不挂代理安装不来。
hertzry
2022-06-17 16:48:10 +08:00
不能用代理。
hertzry
2022-06-17 16:49:51 +08:00
建议你手动下载镜像,然后 docker load 。
fuge
2022-06-17 16:50:39 +08:00
@hertzry 是最近不能用的吗,因为我之前几台机器都是这样安装的,没有问题的。
fuge
2022-06-17 16:51:49 +08:00
@hertzry load 以后,run 会报一样的错误。
bomb77
2022-06-17 16:53:00 +08:00
配置个国内 docker 源镜像试下,别走代理,比如用 daocloud 的 https://www.daocloud.io/mirror
my3157
2022-06-17 16:55:05 +08:00
my3157
2022-06-17 16:55:45 +08:00
看错问题了 :dog:
wccc
2022-06-17 17:05:37 +08:00
yum update ca 更新下?
hertzry
2022-06-17 17:11:13 +08:00
你从别的机器上 docker save 这个镜像,再 docker load 试试?
hertzry
2022-06-17 17:12:25 +08:00
应该是这个镜像还需要下载别的东西。
hertzry
2022-06-17 17:14:30 +08:00
换一个别的代理,这个代理证书不行。我之前用公用的代理也是这个错误,换了自己的代理就好了。
xtinput
2022-06-17 17:14:54 +08:00
centos 不是不维护了吗?
fuge
2022-06-17 17:17:42 +08:00
@hertzry 这个就是我自动的代理,bandwagon 的。。。。
fuge
2022-06-17 17:18:01 +08:00
@xtinput 内网用,不碍事。
fuge
2022-06-17 17:18:38 +08:00
@my3157 没有,谢谢回复,您提供的连接很有帮助。
oott123
2022-06-17 21:06:19 +08:00
yum install ca-certificates

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

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

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

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

© 2021 V2EX