docker的本地仓库换成阿里云的镜像仓库

1,阿里云上注册账号,我的已经注册好了,仓库名称:registry.cn-hangzhou.aliyuncs.com/woccb2/chen

2,本地安装docker:

yum -y install docker-io

systemctl start docker 

vim /etc/docker/daemon.json  # 内容如下:

{
  "registry-mirrors": ["https://cvv5tle1.mirror.aliyuncs.com"]# 这里的镜像源是我专属的, 其他人用可能起不到加速效果
}

 systemctl daemon-reload

 systemctl restart docker

3,在本地注册阿里云的镜像:

 docker login --username=woccb registry.cn-hangzhou.aliyuncs.com/woccb2/chen

输入设置的密码

[root@localhost ~]# docker login --username=woccb registry.cn-hangzhou.aliyuncs.com/woccb2/chen
Password: 
Login Succeeded

docker pull centos

docker images

原文地址:https://www.cnblogs.com/kaishirenshi/p/9247055.html