官网下载:

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

国内镜像下载(gihub上下载docker-compose太慢了,下载不动,只能换成国内镜像daocloud.io):

sudo curl -L https://get.daocloud.io/docker/compose/releases/download/1.26.2/docker-compose-`uname -s`-`uname -m` > /usr/local/bin/docker-compose

添加权限:

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

查看版本:

$ docker-compose --version
docker-compose version 1.26.2, build 1110ad01

 这里是安装的1.26.2版本,如出现更新的版本,建议换成最新版本。官网如下:

https://docs.docker.com/compose/install/#install-compose

docker-compose卸载只需要删除二进制文件就可以了。

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