Docker 镜像加速
安装docker
# yum -y install yum-utils device-mapper-persistent-data lvm2 # yum-config-manager -y --add-repo http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo # yum -y update # yum -y install docker-ce # systemctl enable docker # systemctl start docker # docker --version Docker version 20.10.8, build 3967b7d
设置镜像加速:
# tee /etc/docker/daemon.json <<-'EOF' { "registry-mirrors": ["https://qpc4mmbo.mirror.aliyuncs.com"] } EOF # systemctl daemon-reload # systemctl restart docker
常用镜像加速:
国内从 DockerHub 拉取镜像有时会遇到困难,此时可以配置镜像加速器。Docker 官方和国内很多云服务商都提供了国内加速器服务,例如:
阿里云:https://qpc4mmbo.mirror.aliyuncs.com/
网易:https://hub-mirror.c.163.com/
七牛云加速器:https://reg-mirror.qiniu.com/
科大镜像:https://docker.mirrors.ustc.edu.cn/