linux一键安装Docker-compose脚本

docker-compose的安装相对简单,因为docker-compose依赖于docker,所以需要先安装docker,如果你安装了docker,就不用安装了。

docker安装,请见linux一键安装Docker脚本


一键安装docker-compose

直接复制到您的linux命令行,就能安装docker-compose了。

wget http://66-ai.com/download/script-litte-prince/app/install-docker-compose.sh -O /root/install-docker-compose.sh && sh install-docker-compose.sh

上面的脚本是自动安装docker-compose,如果想看看 install-docker-compose.sh 脚本中是什么,可以看下面的脚本:

#!/usr/bin/env bash

sudo curl -L "https://github.com/docker/compose/releases/download/1.27.4/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose

sudo ln -s /usr/local/bin/docker-compose /usr/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose

echo '安装成功,执行命令:docker-compose -v 进行验证'