-
安装 yum-utils
yum install -y yum-utils device-mapper-persistent-data lvm2
-
为 yum 源添加 docker 仓库位置 yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
-
安装 docker yum install docker-ce
-
启动 docker
systemctl start docker
-
创建网络环境
docker network create centosnetwork
-
docker-compose 安装
-
下载 docker-compose
curl -L https://get.daocloud.io/docker/compose/releases/download/1.24.0\
/docker-compose-`uname -s`-`uname -m` > /usr/local/bin/docker-compose
-
修改权限
chmod +x /usr/local/bin/docker-compose
-
验证是否安装成功 docker-compose --version