1. 安装依赖包
yum install -y yum-utils device-mapper-persistent-data lvm2
2. 设置阿里云docker-ce镜像源
yum-config-manager --add-repo https://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo
3. docker-ce 安装
yum install -y docker-ce
4. docker-compose 安装(最新版)
sudo curl -L "https://github.com/docker/compose/releases/download/$(curl -s https://api.github.com/repos/docker/compose/releases/latest | grep '\"tag_name\":' | sed -E 's/.*\"([^\"]+)\".*/\1/')/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
5. 增加执行权限
sudo chmod +x /usr/local/bin/docker-compose