国内服务器使用docker拉取镜像出现下载超时问题,直觉问题是网络不通,ping相关的域名或IP发现是无法ping通的,鉴于此本文提供两种方法:

1)添加公开的docker加速代理(下文的代理一段时间后可能失效):

        a)vim /etc/docker/daemon.json

{

  "registry-mirrors":

   [

     "https://docker.mirrors.sjtug.sjtu.edu.cn",

      "https://docker.m.daocloud.io",

      "https://noohub.ru",

      "https://huecker.io",

      "https://dockerhub.timeweb.cloud", 

      "https://registry.cn-hangzhou.aliyuncs.com"

   ]

}

    b)systemctl daemon-reload

    c)systemctl restart docker

2)在可连接国外网络的vps或服务器上下载镜像,并迁移:

        a)  docker pull vulfocus/vulfocus:latest

        b)docker save -o /home/test/vulfocus.tar vulfocus/vulfocus:latest

        c)拷贝vulfocus.tar至目标服务器/home/test/vulfocus.tar

        d)docker load -i  /home/test/vulfocus.tar 

参考连接:

1、Docker拉取镜像失败,download failed after attempts 6 IO Timeout,Docker拉取镜像失败,download failed after attempts 6 IO Timeout - 南瓜慢说官网

2、Docker Hub 镜像加速器,https://gist.github.com/y0ngb1n/7e8f16af3242c7815e7ca2f0833d3ea6

Logo

权威|前沿|技术|干货|国内首个API全生命周期开发者社区

更多推荐