阿里云软件镜像,要不要填 cloud ?

我在阿里云的云服务器中,使用 aliyun 镜像打包 docker 镜像

FROM python:3.10-buster

RUN (echo "deb http://mirrors.aliyun.com/debian/ buster main non-free contrib" > /etc/apt/sources.list) 
RUN (apt-get update) && (apt-get upgrade -y)

发现速度非常的感人

然后看了这个 aliyun server 自己的 (/etc/apt/source.list)的镜像配置,发现是:

deb http://mirrors.cloud.aliyuncs.com/debian/ buster main contrib non-free
deb http://mirrors.cloud.aliyuncs.com/debian/ buster-updates main contrib non-free
deb http://mirrors.cloud.aliyuncs.com/debian/ buster-proposed-updates main non-free contrib
deb http://mirrors.cloud.aliyuncs.com/debian/ buster-backports main non-free contrib

发现域名不一样!

所以要走内网要 http://mirrors.cloud.aliyuncs.com/debian/ ?

aliyun 不会自己判断内外吗?难道不应该设置为即便使用 『http://mirrors.aliyun.com/deb... 』也应该主动判断内外吗?


同理,比如 pypi 的 aliyun 镜像,一般是 http://mirrors.aliyun.com/pypi/simple/,如果我要内网使用的话,是不要也要换成 http://mirrors.cloud.aliyuncs.com/pypi/simple/

使用失败

not fetch URL https://mirrors.cloud.aliyuncs.com/pypi/simple/pip/: There was a problem confirming the ssl certificate: HTTPSConnectionPool(host='mirrors.cloud.aliyuncs.com', port=443): Max retries exceeded with url: /pypi/simple/pip/ (Caused by SSLError(CertificateError("hostname 'mirrors.cloud.aliyuncs.com' doesn't match 'mirrors-ssl.aliyuncs.com'"))) - skipping

为什么 aliyun 不做一个自动判断?貌似并没有技术难度,还能给 aliyun 剩下保留的流量费

阅读 2.1k
1 个回答

亲测,对于 aliyun 中的机器,填写 http://mirrors.cloud.aliyuncs.com/debian/ 走的是内网,下载速度可以到 几十MB/s

但是 http://mirrors.aliyun.com/debian/ 走的却是公网,速度非常的感人,一开始几秒可以有 几MB/s,之后就是 几十KB/s

撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题