1.修改自己的鏡像源地址(需要管理員權限編輯)
在 /etc/docker/daemon.json 配置 docker的鏡像地址,這是我目前配置的鏡像源信息。
[henry@192 ~]$ cat /etc/docker/daemon.json { "debug":true, "registry-mirrors": [ "https://hub-mirror.c.163.com", "https://dockerproxy.com", "https://mirror.baidubce.com", "https://ccr.ccs.tencentyun.com", "https://docker.m.daocloud.io" ] }
參考地址:https://juejin.cn/post/7165806699461378085
千萬注意了!!!
這裏的 json 文件,一定要是嚴格的json格式,否則會導致 docker 無法啓動。
這裏的 json 文件,一定要是嚴格的json格式,否則會導致 docker 無法啓動。
這裏的 json 文件,一定要是嚴格的json格式,否則會導致 docker 無法啓動。
2.如何驗證 鏡像地址 是否可用:
2.1使用 telnet 方法(不帶https前綴)
[henry@192 ~]$ telnet mirror.baidubce.com 443 Trying 163.177.18.137... Connected to mirror.baidubce.com. Escape character is '^]'. ^C^C^CConnection closed by foreign host. [henry@192 ~]$ ^C
當出現
Connected to xxx
就表示 成功了。
2.2 使用curl -I 方法
[henry@192 ~]$ curl -I mirror.baidubce.com HTTP/1.1 200 OK Server: nginx/1.10.1 Date: Thu, 25 Apr 2024 22:16:09 GMT Content-Type: text/html Content-Length: 73 Last-Modified: Thu, 22 Jun 2017 10:58:50 GMT Connection: keep-alive ETag: "594ba2ea-49" Accept-Ranges: bytes
當返回
HTTP/1.1 200 OK
就表示成功了