docker-compose安装

docker-compose的三种安装方式

1. pip安装

1
sudo pip install -U docker-compose

添加补全命令

1
2
3
curl -L https://raw.githubusercontent.com/docker/compose/1.24.0/contrib/completion/bash/docker-compose > /etc/bash_completion.d/docker-compose

. /etc/bash_completion.d/docker-compose

2. 二进制

二进制安装包在 https://github.com/docker/compose/releases

1
2
curl -L https://github.com/docker/compose/releases/download/1.24.0/docker-compose-`uname -s`-`uname -m` -o /usr/local/bin/docker-compose
chmod +x /usr/local/bin/docker-compose

3. 容器中执行

1
2
3
curl -L https://github.com/docker/compose/releases/download/1.24.0/run.sh > /usr/local/bin/docker-compose

chmod +x /usr/local/bin/docker-compose

4. 卸载

删除二进制包

1
rm /usr/local/bin/docker-compose

pip卸载

1
pip unstall docker-compose
-------------本文结束-------------