方法1:
pip安装
[root@harbor ~]# which pip3
/usr/local/bin/pip3
[root@harbor ~]# pip3 install docker-compose
方法2:
二进制文件安装
下载后添加可执行权限
curl -L https://github.com/docker/compose/releases/download/1.16.1/docker-compose-`uname -s`-`uname -m` -o /usr/local/bin/docker-compose
chmod +x /usr/local/bin/docker-compose
方法3:
ansible安装
[root@localhost docker]# cat 3-wget-docker-compose.yml
---
- hosts: k1
remote_user: root
tasks:
- name: download docker-compose
get_url:
url: https://github.com/docker/compose/releases/download/1.16.1/docker-compose-Linux-x86_64
dest: /usr/local/bin/docker-compose
- name: chown +x docker-compose
file:
path: /usr/local/bin/docker-compose
mode: 0750