安装 docker-compose

  1. 最新发行的版本地址:https://github.com/docker/compose/releases
  2. 运行以下命令以下载Docker Compose的当前稳定版本:
sudo curl -L "https://github.com/docker/compose/releases/download/1.27.2/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose

将可执行权限应用于二进制文件:
sudo chmod +x /usr/local/bin/docker-compose
注意:如果命令docker-compose在安装后失败,请检查您的路径。您还可以创建指向/usr/bin或路径中任何其他目录的符号链接。

测试安装
docker-compose --version
bash 命令补齐
curl -L https://raw.githubusercontent.com/docker/compose/1.8.0/contrib/completion/bash/docker-compose > /etc/bash_completion.d/docker-compose
卸载docker-compose
直接移除二进制包即可

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