解决方案
1、vim进入阿里云镜像加速配置文件
vim /etc/docker/daemon.json
2、修改配置文件
完整的配置
sudo mkdir -p /etc/docker
sudo tee /etc/docker/daemon.json <<-‘EOF’
{
“registry-mirrors”: [“https://06wo2xso.mirror.aliyuncs.com”]
}
EOF
sudo systemctl daemon-reload
sudo systemctl restart docker
需要删除{}上面两条指令
改为如下即可
{
"registry-mirrors": ["https://06wo2xso.mirror.aliyuncs.com"]
}
sudo systemctl daemon-reload
sudo systemctl restart docker
3、保存退出,重启即可
[root@javaEE ~]# systemctl start docker
[root@javaEE ~]# docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
tomcat latest 710ec5c56683 10 hours ago 668MB
nginx latest 08b152afcfae 2 weeks ago 133MB
hello-world latest d1165f221234 5 months ago 13.3kB
centos latest 300e315adb2f 8 months ago 209MB