安装docker
curl -fsSL https://get.docker.com | bash -s docker --mirror Aliyun
启动docker服务
systemctl start docker
设置docker开机自启
systemctl enable docker
配置docker加速器
mkdir -p /etc/docker
tee /etc/docker/daemon.json <<-'EOF'
{
"log-driver": "json-file",
"log-opts": {
"max-size": "10m",
"max-file": "3"
},
"registry-mirrors":["https://xxx.xxx.xxx.cn/"]
}
EOF
重启docker服务
systemctl daemon-reload
systemctl restart docker
echo "Docker安装完成!"