安装docker
安装所需的包:
sudo yum install -y yum-utils device-mapper-persistent-data lvm2
设置稳定存储库:
sudo yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
安装docker-ce
yum -y install docker-ce
systemctl start docker
systemctl enable docker
查看docker版本
docker version
安装docker-compose
sudo curl -L "https://github.com/docker/compose/releases/download/1.25.0/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose
sudo ln -s /usr/local/bin/docker-compose /usr/bin/docker-compose
待安装完成后,执行查询版本的命令确认安装成功
docker-compose version