删除旧的docker(如果有)
sudo yum remove docker
安装必须的依赖
sudo yum install -y yum-utils device-mapper-persistent-data lvm2
添加stable的Docker-ce源
sudo yum-config-manager --add-repo http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo
安装docker-ce
sudo yum install docker-ce docker-ce-cli containerd.io
安装docker-compose
sudo curl -L "https://github.com/docker/compose/releases/download/1.26.2/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
给予执行权限
sudo chmod +x /usr/local/bin/docker-compose