假如你已經在云服務器上安裝了docker
需要配置下docker鏡像加速代理就行了
找到自己的加速網址:
然后在云服務器上,修改docker 配置文件,
vi /etc/docker/daemon.json
沒有這個文件的話,需要創建一個。
{
"default-address-pools": [
{
"base": "10.10.0.0/16",
"size": 24
}
],
"registry-mirrors": [
"https://改成你的url.mirror.aliyuncs.com"
]
}
保存之后,需要重啟下dockers
sudo systemctl daemon-reload
sudo systemctl restart docker
然后就可以docker pull? 了
其他鏡像加速地址:
? ? "https://2a6bf1988cb6428c877f723ec7530dbc.mirror.swr.myhuaweicloud.com",
"https://docker.m.daocloud.io",
"https://hub-mirror.c.163.com",
"https://mirror.baidubce.com",
"https://your_preferred_mirror",
"https://dockerhub.icu",
"https://docker.registry.cyou",
"https://docker-cf.registry.cyou",
"https://dockercf.jsdelivr.fyi",
"https://docker.jsdelivr.fyi",
"https://dockertest.jsdelivr.fyi",
"https://mirror.aliyuncs.com",
"https://dockerproxy.com",
"https://mirror.baidubce.com",
"https://docker.m.daocloud.io",
"https://docker.nju.edu.cn",
"https://docker.mirrors.sjtug.sjtu.edu.cn",
"https://docker.mirrors.ustc.edu.cn",
"https://mirror.iscas.ac.cn",
"https://docker.rainbond.cc"
拉取報錯
[root@localhost ~]# docker pull zookeeper
Using default tag: latest
Error response from daemon: Get "https://registry-1.docker.io/v2/": net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers)
解決方法
編寫配置文件
將可用的鏡像倉庫地址寫入到?
daemon.json
?配置文件中(目前2024年10月08日可用的源)
[root@localhost ~]# vim /etc/docker/daemon.json
[root@localhost ~]# more /etc/docker/daemon.json
{"registry-mirrors": ["https://2a6bf1988cb6428c877f723ec7530dbc.mirror.swr.myhuaweicloud.com","https://docker.m.daocloud.io","https://hub-mirror.c.163.com","https://mirror.baidubce.com","https://your_preferred_mirror","https://dockerhub.icu","https://docker.registry.cyou","https://docker-cf.registry.cyou","https://dockercf.jsdelivr.fyi","https://docker.jsdelivr.fyi","https://dockertest.jsdelivr.fyi","https://mirror.aliyuncs.com","https://dockerproxy.com","https://mirror.baidubce.com","https://docker.m.daocloud.io","https://docker.nju.edu.cn","https://docker.mirrors.sjtug.sjtu.edu.cn","https://docker.mirrors.ustc.edu.cn","https://mirror.iscas.ac.cn","https://docker.rainbond.cc"]
}
[root@localhost ~]#
重新加載一下docker的配置文件
[root@localhost ~]# systemctl daemon-reload
重啟一下docker服務
[root@localhost ~]# systemctl restart docker.service
拉一下鏡像
[root@localhost ~]# docker pull zookeeper