docker 官网:https://docs.docker.com/install/linux/docker-ce/centos/
docker 安装:
1.清空原有安装包
yum remove docker \
docker-client \
docker-client-latest \
docker-common \
docker-latest \
docker-latest-logrotate \
docker-logrotate \
docker-engine
2. 安装必要的系统工具
yum install -y yum-utils \
device-mapper-persistent-data \
lvm2
3.添加软件源信息
yum-config-manager \
--add-repo \
https://download.docker.com/linux/centos/docker-ce.repo
4. 安装docker-ce
yum -y install docker-ce
5. 启动docker
systemctl start docker
6.测试是否安装成功
docker pull hello-world;//拉取镜像
docker run hello-world://显示有Hello from Docker证明docker安装成功
7.docker 镜像加速
vim /etc/docker/key.json
{ "registry-mirrors": ["http://hub-mirror.c.163.com"] }
8.重启docker
systemctl restart docker