1. Download docker-compose binary file installation from github(Some troublesome)
downloaddocker-composedocument
[root@hadoop100 ~]# sudo curl -L /docker/compose/releases/download/1.16.1/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 617 0 617 0 0 95 0 --:--:-- 0:00:06 --:--:-- 156
15 8648k 15 1359k 0 0 3514 0 0:42:00 0:06:36 0:35:24 0
curl: (56) TCP connection reset by peer
- 1
- 2
- 3
- 4
- 5
- 6
Add executable permissions and test the installation results
[root@hadoop100 ~]# sudo chmod +x /usr/local/bin/docker-compose
[root@hadoop100 ~]# docker-compose --version
Cannot open self /usr/local/bin/docker-compose or archive /usr/local/bin/docker-compose.pkg
- 1
- 2
- 3
However, we found an error, and docker-compose is also available when entering this bin directory
[root@hadoop100 bin]# llTotal dosage: 1360-rwxr-xr-x.1 root root 1392194 October 25 10:26 docker-compose
- 1
- 2
- 3
Solution:
Go to the following URL to download the current latest version:
https://github.com/docker/compose/releases/tag/1.14.0-rc2
Pull the web page to the bottom and download:
docker-compose-Linux-x86_64
Then upload the file to the /usr/local/bin/ folder
[root@hadoop100 bin]# llTotal dosage 9448-rwxr-xr-x.1 root root 1392194 October 25 10:26 docker-compose
-rw-r--r--.1 root root 8278064 October 25 10:57 docker-compose-Linux-x86_64
- 1
- 2
- 3
- 4
Then rename it to docker-compose and modify the permissions of this file
[root@hadoop100 bin]# mv docker-compose-Linux-x86_64 docker-compose
mv: Whether to cover"docker-compose"? yes
[root@hadoop100 bin]# llTotal dosage 8088-rw-r--r--.1 root root 8278064 October 25 10:57 docker-compose
- 1
- 2
- 3
- 4
- 5
[root@hadoop100 bin]# sudo chmod +x /usr/local/bin/docker-compose
[root@hadoop100 bin]# docker-compose --version
docker-compose version 1.14.0-rc2, build 24dae73
- 1
- 2
- 3
Installation (recommended)
2.1. Install python-pip
[root@hadoop100 bin]# yum -y install epel-release
[root@hadoop100 bin]# yum -y install python-pip
- 1
- 2
2.2. Install docker-compose
[root@hadoop100 bin]# pip install docker-compose
- 1
After the installation is completed, execute the command to query the version.
[root@hadoop100 bin]# docker-compose version
docker-compose version 1.14.0-rc2, build 24dae73
docker-py version: 2.3.0
CPython version: 2.7.13
OpenSSL version: OpenSSL 1.0.1t 3 May 2016
- 1
- 2
- 3
- 4
- 5