docker_practice/compose/install.md

72 lines
2.2 KiB
Go
Raw Permalink Blame History

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

#
`Compose` LinuxmacOSWindows 10
`Compose` Python `pip` 使 Docker
`Docker Desktop for Mac/Windows` `docker-compose` Docker 使
```bash
$ docker-compose --version
docker-compose version 1.27.4, build 40524192
```
Linux 使
##
Linux [ GitHub Release](https://github.com/docker/compose/releases) 处直接下载编译好的二进制文件即可。
Linux 64
```bash
$ sudo curl -L https://github.com/docker/compose/releases/download/1.27.4/docker-compose-`uname -s`-`uname -m` > /usr/local/bin/docker-compose
# 国内用户可以使用以下方式加快下载
$ sudo curl -L https://download.fastgit.org/docker/compose/releases/download/1.27.4/docker-compose-`uname -s`-`uname -m` > /usr/local/bin/docker-compose
$ sudo chmod +x /usr/local/bin/docker-compose
```
## PIP
** `x86_64` Linux `ARM` ()使 `pip`
Compose Python pip
```bash
$ sudo pip install -U docker-compose
```
```bash
Collecting docker-compose
Downloading docker-compose-1.27.4.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
```bash
$ curl -L https://raw.githubusercontent.com/docker/compose/1.27.4/contrib/completion/bash/docker-compose > /etc/bash_completion.d/docker-compose
```
##
```bash
$ sudo rm /usr/local/bin/docker-compose
```
`pip`
```bash
$ sudo pip uninstall docker-compose
```