1.配置yum源
cd /etc/yum.repos.dwget https://download.docker.com/linux/centos/docker-ce.repo
2.安装docker-ce
yum install docker-ce -y
3.启动并设置开机自启动
systemctl start docker
systemctl enable docker4.配置国内源
vi /etc/docker/daemon.json
{
“registry-mirrors”: [““] }5.重启
reload 配置,记住docker更改了类似源操作都需要进行reload 再重启docker 服务
systemctl daemon-reload
systemctl restart docker