在线安装
- 安装依赖包
sudo yum install -y yum-utils device-mapper-persistent-data lvm2
- 添加源:aliyun
sudo yum-config-manager --add-repo http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo
- 安装docker-ce
sudo yum makecache
sudo yum install docker-ce
- 启动docker
systemctl enable docker
sudo systemctl start docker
- 安装docker-compose
sudo curl -L https://github.com/docker/compose/releases/download/1.25.3/docker-compose-`uname -s`-`uname -m` -o /usr/local/bin/docker-compose
chmod +x /usr/local/bin/docker-compose