docker镜像环境配置

#安装docker软件

yum -y install yum-utils 
yum -y install docker-ce docker-ce-cli containerd.ip

#备份yum源

mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup

#阿里云
#社区主页
https://developer.aliyun.com/mirror/

curl -o /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-7.repo

wget -O /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-7.repo

#加速器

mkdir -p /etc/docker
tee /etc/docker/daemon.json <<-'EOF'
{
  "registry-mirrors": ["https://7383ifny.mirror.aliyuncs.com"]
}
EOF
systemctl daemon-reload
systemctl restart docker

#网易云
#镜像主页
https://mirrors.163.com

curl -o /etc/yum.repos.d/CentOS-Base.repo http://mirrors.163.com/.help/CentOS7-Base-163.repo

wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.163.com/.help/CentOS7-Base-163.repo

#加速器

mkdir -p /etc/docker
tee /etc/docker/daemon.json <<-'EOF'
{
  "registry-mirrors": ["http://hub-mirror.c.163.com"]
}
EOF
systemctl daemon-reload
systemctl restart docker

#其它加速器
#中科大 http://mirrors.ustc.edu.cn/
#清华 https://mirrors.tuna.tsinghua.edu.cn/
#腾讯 https://mirrors.cloud.tencent.com/
#华为 https://mirrors.huaweicloud.com/

#图形化管理工具
#portainer

docker run -d --name portainer --restart=always -p 8088:9000 -v /var/run/docker.sock:/var/run/docker.sock --privileged=true portainer/portainer