升级内核
yum update
安装基本依赖
# 安装基本依赖
yum install -y yum-utils device-mapper-persistent-data lvm2
#添加阿里源
yum-config-manager --add-repo http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo
yum install -y docker-ce-18.03.1.ce
#配置自动启动
systemctl start docker && systemctl enable docker
遇到问题
Error starting daemon: Error initializing network controller: list bridge addresses failed: no available network
缺少docker0这个网络,手动添加
参考https://github.com/docker/for-linux/issues/123
ip link add name docker0 type bridge
ip addr add dev docker0 172.17.0.1/16