gpt4 book ai didi

image - 哪个云区域可能最快速地推送docker镜像?

转载 作者:行者123 更新时间:2023-12-02 18:50:43 25 4
gpt4 key购买 nike

TLDR
如何知道云中最靠近Docker Hub的区域?

完整详细信息
从我的本地主机,我的网络将docker镜像推送到docker hub的速度非常慢。

我的解决方法是使用云机器来执行docker image push,希望那里的互联网会更快。

所以我的问题是,云上哪个区域最靠近Docker Hub供我选择?

My google search结果有点帮助

ps。我还问了devops姐妹网站here

最佳答案

registryhub.docker.com服务器的主机名

如果您的问题是指公用服务器hub.docker.com,则它是注册表has address registry-1.docker.ioA-recordsregistry.docker.io
您可以使用A-recordsdig找到实际的DNS nslookup

nslookup -type=A registry.docker.io                                                                                                                           6.66 Dur  23:22:32 
Server: 127.0.0.53
Address: 127.0.0.53#53

Non-authoritative answer:
registry.docker.io canonical name = registry-1.docker.io.
Name: registry-1.docker.io
Address: 52.206.192.146
Name: registry-1.docker.io
Address: 52.87.94.70
Name: registry-1.docker.io
Address: 52.55.198.220
Name: registry-1.docker.io
Address: 54.152.200.115
Name: registry-1.docker.io
Address: 54.164.50.37
Name: registry-1.docker.io
Address: 52.2.169.2
Name: registry-1.docker.io
Address: 52.202.253.107
Name: registry-1.docker.io
Address: 52.201.142.14
 dig +short registry.docker.io A                                                                                                                              
registry-1.docker.io.
54.210.105.17
3.210.179.11
3.224.11.4
54.164.50.37
3.221.133.86
100.24.246.89
3.209.173.81
54.174.39.59

地理位置的 ipinfo
There are some CLI tools用于IP地理位置,让我们使用 ipinfo
例如,最接近的Cloudflare服务器的 ipinfo:
curl ipinfo.io/1.1.1.1                                                                                                                                                  {
"ip": "1.1.1.1",
"hostname": "one.one.one.one",
"city": "Haymarket",
"region": "New South Wales",
"country": "AU",
"loc": "-33.8661,151.2040",
"org": "AS13335 Cloudflare, Inc.",
"postal": "2000",
"timezone": "Australia/Sydney",
"readme": "https://ipinfo.io/missingauth"
}

使用 city 提取 hostnamejq
由于 ipinfoJSON格式返回答案,因此我们可以对其进行解析。 jq是用于此类任务的便捷工具。
curl -s ipinfo.io/54.210.105.17 | jq -r '{city:.city, host:.hostname}'
{
"city": "Virginia Beach",
"host": "ec2-54-210-105-17.compute-1.amazonaws.com"
}


所有 registry服务器的最近城市

让我们尝试查找所有已解析服务器的最近城市:
for addr in $(dig +short registry-1.docker.io A); do
curl -s ipinfo.io/$addr | jq -r '{city:.city, host:.hostname}';
done
{
"city": "Virginia Beach",
"host": "ec2-3-209-173-81.compute-1.amazonaws.com"
}
{
"city": "Virginia Beach",
"host": "ec2-54-210-105-17.compute-1.amazonaws.com"
}
{
"city": "Virginia Beach",
"host": "ec2-100-24-246-89.compute-1.amazonaws.com"
}
{
"city": "Virginia Beach",
"host": "ec2-3-224-11-4.compute-1.amazonaws.com"
}
{
"city": "Virginia Beach",
"host": "ec2-54-164-50-37.compute-1.amazonaws.com"
}
{
"city": "Virginia Beach",
"host": "ec2-3-221-133-86.compute-1.amazonaws.com"
}
{
"city": "Virginia Beach",
"host": "ec2-3-210-179-11.compute-1.amazonaws.com"
}
{
"city": "Virginia Beach",
"host": "ec2-54-174-39-59.compute-1.amazonaws.com"
}

关于image - 哪个云区域可能最快速地推送docker镜像?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/61029378/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com