https://docs.docker.com/install/linux/docker-ce/centos/
1.
yum -y install gcc
yum -y install gcc-c++
2. 删除旧的
$ sudo yum remove docker docker-client docker-client-latest docker-common docker-latest docker-latest-logrotate docker-logrotate docker-engine
3.
$ sudo yum install -y yum-utils device-mapper-persistent-data lvm2
4.设置 阿里镜像
yum-config-manager --add-repo http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo
5.更新yum
yum makecache fast
6.安装 docker ce
yum -y install docker-ce
7. 启动 docker
systemctl start docker
8.查看 docker 版本
docker version
配置镜像加速
mkdir -p /etc/docker
vim /etc/docker/daemon.json
#网易云 {"registry-mirrors":["http://hub-mirror.c.163.com"]} #阿里云 {"registry-mirrors":["https://{自己编码}.mirror.aliyuncs.com"]}
重新加载
systemctl daemon-reload
systemctl restart docker
安装完成