05|Docker-Compose

安装docker-compose

前提先安装docker 参考前面的文档。

从github上下载docker-compose二进制文件安装

1
2
3
4
# github 下载
sudo curl -L https://github.com/docker/compose/releases/download/1.16.1/docker-compose-`uname -s`-`uname -m` -o /usr/local/bin/docker-compose
# daocloud 下载(速度快)
sudo curl -L https://get.daocloud.io/docker/compose/releases/download/1.25.1/docker-compose-`uname -s`-`uname -m` -o /usr/local/bin/docker-compose

添加权限

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

pip安装

1
sudo pip install docker-compose

验证测试结果

1
2
3
$ docker-compose --version

docker-compose version 1.25.5, build 8a1c60f6

删除docker-compose

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

创建Docker-compose.yml文件