docker默认的源为国外官方源,下载速度较慢,可改为国内源

方案一

修改或新增 docker默认的配置文件 vim /etc/docker/daemon.json

{
   "registry-mirrors": ["http://hub-mirror.c.163.com"]
}
{
  "builder": {
    "gc": {
      "defaultKeepStorage": "20GB",
      "enabled": true
    }
  },
  "experimental": false,
  "features": {
    "buildkit": true
  },
  "registry-mirrors": [
    "https://registry.docker-cn.com",
    "https://docker.mirrors.ustc.edu.cn",
    "http://hub-mirror.c.163.com"
  ]
}

在这里插入图片描述

# 重启docker
service docker restart
# 查看是否成功
docker info

在这里插入图片描述

方案二

修改或新增 vim /etc/sysconfig/docker

# 在OPTIONS变量后追加参数 --registry-mirror=https://docker.mirrors.ustc.edu.cn
OPTIONS='--selinux-enabled --log-driver=journald --registry-mirror=https://docker.mirrors.ustc.edu.cn'

方案三

阿里云docker镜像加速,提升pull的速度
在这里插入图片描述

在这里插入图片描述

​Docker国内源说明:

  • Docker 官方中国区:https://registry.docker-cn.com
  • 网易:http://hub-mirror.c.163.com
  • 中国科技大学:https://docker.mirrors.ustc.edu.cn
  • 阿里云:https://pee6w651.mirror.aliyuncs.com
  • docker官网中国区镜像 --registry-mirror=https://registry.docker-cn.com
  • 网易163 docker镜像 --registry-mirror=http://hub-mirror.c.163.com
  • USTC镜像加速 --registry-mirror=https://docker.mirrors.ustc.edu.cn
  • alicloud --registry-mirror=https://{your_id}.mirror.aliyuncs.com
Logo

旨在为数千万中国开发者提供一个无缝且高效的云端环境,以支持学习、使用和贡献开源项目。

更多推荐