docker run出現問題(Client.Timeout exceeded while awaiting headers)

在拉取鏡像的時候報錯Client.Timeout exceeded while awaiting headers

原因:延遲較大,網絡連接出現問題

 

解決辦法

dotcloud官方頁面內也有不同操作系統的教程

 

這裏貼出Linux下的解決方案:

①  curl -sSL https://get.daocloud.io/daotools/set_mirror.sh | sh -s http://f1361db2.m.daocloud.io

該腳本可以將 --registry-mirror 加入到你的 Docker 配置文件 /etc/docker/daemon.json 中。適用於 Ubuntu14.04、Debian、CentOS6 、CentOS7、Fedora、Arch Linux、openSUSE Leap 42.1,其他版本可能有細微不同

上面的命令會在/etc/docker/daemon.json文件添加上如下配置

加載配置文件、重啓docker

$systemctl daemon-reload

$systemctl restart docker 

重新拉取鏡像(成功)

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章