docker 安装与使用的相关问题

Error response from daemon: i/o timeout

$ sudo docker search centos
Error response from daemon: Get https://index.docker.io/v1/search?q=centos&n=25: dial tcp 3.225.34.151:443: i/o timeout

$ sudo vim /etc/docker/daemon.json
{
    "registry-mirrors": ["http://hub-mirror.c.163.com"]
}
or
{
  "registry-mirrors": ["https://registry.docker-cn.com"]
}

$ sudo vim /etc/resolv.conf
# Dynamic resolv.conf(5) file for glibc resolver(3) generated by resolvconf(8)
#     DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN
nameserver 127.0.1.1
nameserver 8.8.8.8
nameserver 8.8.4.4

$ sudo systemctl daemon-reload
$ sudo systemctl restart docker

$ sudo docker search centos
NAME                               DESCRIPTION                                     STARS               OFFICIAL            AUTOMATED
centos                             The official build of CentOS.                   5626                [OK]
ansible/centos7-ansible            Ansible on Centos7                              125                                     [OK]
jdeathe/centos-ssh                 OpenSSH / Supervisor / EPEL/IUS/SCL Repos - …   114                                     [OK]
consol/centos-xfce-vnc             Centos container with "headless" VNC session…   99                                      [OK]
posted @ 2019-10-24 15:16  qccz123456  阅读(180)  评论(0编辑  收藏  举报