Centos7.8
已安装Docker Engine
Docker Compose
运行以下命令下载稳定版本Docker Compose
$ sudo curl -L "https://github.com/docker/compose/releases/download/1.28.5/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
实践如下
# curl -L "https://github.com/docker/compose/releases/download/1.28.5/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 633 100 633 0 0 38 0 0:00:16 0:00:16 --:--:-- 148 100 11.6M 100 11.6M 0 0 75813 0 0:02:41 0:02:41 --:--:-- 61868
注意:要等待下载完成,下载完成后会自动退出命令
给下载的二进制文件增加可执行权限
$ sudo chmod +x /usr/local/bin/docker-compose
为方便执行命令,增加软连接
$ sudo ln -s /usr/local/bin/docker-compose /usr/bin/docker-compose
测试验证是否安装成功
$ docker-compose --version docker-compose version 1.28.5, build c4eb3a1f
如果软件包没下载完全,执行上述命令时可能报错:
[110532] Cannot open self /usr/local/bin/docker-compose or archive /usr/local/bin/docker-compose.pkg
Docker Compose
如果使用curl
安装的docker compose
,则采用以下方式卸载:
$ sudo rm /usr/local/bin/docker-compose
如果使用pip
安装的docker compose
,则采用以下方式卸载:
$ pip uninstall docker-compose