https://www.cnblogs.com/FRESHMANS/p/8435379.html

 

二进制包

$ sudo curl -L https://github.com/docker/compose/releases/download/1.17.1/docker-compose-`uname -s`-`uname -m` > /usr/local/bin/docker-compose
$ sudo chmod +x /usr/local/bin/docker-compose

 

PIP 安装

这种方式是将 Compose 当作一个 Python 应用来从 pip 源中安装。

执行安装命令:

$ sudo pip install -U docker-compose

 

可以看到类似如下输出,说明安装成功。

Collecting docker-compose
  Downloading docker-compose-1.17.1.tar.gz (149kB): 149kB downloaded
...
Successfully installed docker-compose cached-property requests texttable websocket-client docker-py dockerpty six enum34 backports.ssl-match-hostname ipaddress

 

bash 补全命令

$ curl -L https://raw.githubusercontent.com/docker/compose/1.8.0/contrib/completion/bash/docker-compose > /etc/bash_completion.d/docker-compose

 

容器中执行

$ curl -L https://github.com/docker/compose/releases/download/1.8.0/run.sh > /usr/local/bin/docker-compose
$ chmod +x /usr/local/bin/docker-compose

 

卸载

如果是二进制包方式安装的,删除二进制文件即可。
$ sudo rm /usr/local/bin/docker-compose
如果是通过 pip 安装的,则执行如下命令即可删除。 $ sudo pip uninstall docker
-compose

发表评论

邮箱地址不会被公开。 必填项已用*标注