# Docker Hub 镜像国内加速

# 1. 配置加速地址

创建或修改 /etc/docker/daemon.json

mkdir -p /etc/docker
sudo tee /etc/docker/daemon.json <<-'EOF'
{
    "registry-mirrors": [
        "https://dockerproxy.com",
        "https://docker.mirrors.ustc.edu.cn",
        "https://docker.nju.edu.cn"
    ]
}
EOF
systemctl daemon-reload
systemctl restart docker

# 2. 可用列表

  1. https://registry.docker-cn.com/
  2. https://docker.m.daocloud.io/
  3. https://dockerproxy.com/
  4. https://mirror.baidubce.com/
  5. https://docker.nju.edu.cn/
  6. https://mirror.iscas.ac.cn/
  7. ...

# 3. 检查加速器是否生效

docker info

输出中会看到类似下面的内容:

 ...
 Registry Mirrors:
  https://registry.docker-cn.com/
  https://docker.m.daocloud.io/
  https://dockerproxy.com/
  https://mirror.baidubce.com/
  https://docker.nju.edu.cn/
  https://mirror.iscas.ac.cn/
 ...