当前docker hub国外的镜像站访问的速度非常的慢。最近,在使用阿里云ecs时看到阿里云上为用户提供了容器hub的mirror镜像。在打开容器hub服务的控制台(https://cr.console.aliyun.com/#/docker/image/list)上有一个加速器配置。加速器配置里面,给用户指定了一个加速器地址,可供用户使用。将加速器地址配置
到docker daemon启动的参数中即可。以centos7为例子:
# /etc/sysconfig/docker
# Modify these options if you want to change the way the docker daemon runs
OPTIONS='--registry-mirror=https://xxxxxx.mirror.aliyuncs.com --selinux-enabled --log-driver=journald'
配置想中具体的加速器地址可在hub的控制台中获取。