准备环境
- CentOS 7
安装 Docker Engine
更新 yum 包
$ yum update
安装依赖和添加仓库
$ yum install -y yum-utils
$ yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
安装 Docker Engine
$ yum install -y docker-ce
启动 Docker Engine 并允许开机自启动
$ systemctl start docker && systemctl enable docker
安装 Docker Compose
curl -L "https://github.com/docker/compose/releases/download/1.29.2/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
添加可执行权限
$ chmod +x /usr/local/bin/docker-compose