Docker Compose can be installed in a variety of environments
One, online installation
Only an online installation of the Linux x86 architecture has been attempted so far
1. Download the docker – compose
Docker-compose download docker-compose to /usr/local/bin/
$sudo curl -l https://github.com/docker/compose/releases/download/1.17.1/docker-compose- ` ` uname - s - ` uname -m ` > / usr /local/bin/docker-compose
Copy the code
2. Give docker-compose execution permission
$ sudo chmod +x /usr/local/bin/docker-compose
Copy the code
3. Verify
[root@localhost bin]# docker-compose -versionDocker-compose version 1.21.2, build e7de1BCCopy the code
Two, offline installation
Docker-compose installation for Linux x86
Method 1. Install using a binary file
Linux x86 as long as the corresponding docker – compose of Linux version of https://github.com/docker/compose/releases send under Linux binaries and downloaded to a local, Copy to /usr/local/bin/and it will work.
Method 2. Compile and install the software using Python
Download the dockerCompoes source code from Github. Then perform the following steps:
- Enter the docker-compose source directory
- Run python setup.py install
(2) Other system installation processes without binary files
For some architectures, the Docker-compose binary is not officially available and you need to manually compile and install it yourself. Others that are not officially provided will require manual compilation and installation using Python
After trying, it seems that only python compilation can successfully install, and the following three methods fail.
Compile and install using Python
Docker-compose github source docker-compose github source docker-compose github
- Enter the docker-compose source directory
- perform
python setup.py install
An error
Docker compose: docker compose: docker compose: docker compose: docker compose: docker compose: docker compose: docker compose: docker compose: docker compose: docker compose: docker compose: docker compose: docker compose: docker compose: Docker compose: Docker compose
Download and view the requests versions in the requirees. TXT file in the source code, find the versions that match the installed Docker, and then install again, reporting that the versions of Texttable are incorrect. And no network can’t automatically download, only to https://pypi.org/project/texttable/ to find a corresponding version manually download, compile the installation.
Resolve the lack of dependencies
This kind of dependency problem should be downloaded from the Python website, and then compiled and installed. An example:
Install both requests and Texttable dependencies, and docker-compose corresponds to the Docker version. Continue the Python compilation installation
- Enter the docker-compose source directory
- perform
python setup.py install
Error:
Installed/usr/lib/python2.7 / site - packages/docker_compose - 1.21.2 - py2.7. Egg Processing dependenciesforDocker - compose = = 1.21.2 SearchingforDocker < 4.0 > = https://pypi.python.org/simple/docker/ Download 3.3.0 Reading error on https://pypi.python.org/simple/docker/: [Errno -2] Name or service not known -- Some packages may not be found! Couldn't retrieve index page for 'docker'
Scanning index of all packages (this may take a while)
Reading https://pypi.python.org/simple/
Download error on https://pypi.python.org/simple/: [Errno -2] Name or service not known -- Some packages may not be found!
No local packages or download links found for docker<4.0,>=3.3.0
error: Could not find suitable distribution for Requirement.parse('Docker < 4.0 > = 3.3.0')
Copy the code
Reason: the docker under the python version error, again to pypi.python.org/simple/dock…
-
Go to the downloaded Python Docker3.3.0 directory
-
Run the python setup.py install command
-
Output:
. . Using the/usr/lib/python2.7 / site - packages/idna - 2.5 - py2.7. Egg SearchingforChardet ==3.0.2 Best match: chardet 3.0.2 Processing chardet-3.0.2-py2.7. Egg chardet 3.0.2 is already the active versioninPTH Installing Chardetect script to /usr/bin Using /usr/lib/python2.7/site-packages/chardet-3.0.2-py2.7.egg Finished processing dependenciesforDocker = = 3.3.0Copy the code
-
Enter the docker-comement-1.21.2 directory again
Docker-compose sh [root@localhost docker-3.3.0]# CD.. / docker-comemy-1.21.2 / [root@localhost docker-comemy-1.21.2]# ls build compose dist LICENSE readme.rst setup.cfg tests CHANGELOG.md contrib docker_compose.egg-info MANIFEST.in requirements-dev.txt setup.py tox.ini CHANGES.md CONTRIBUTING. Md Dockerfile [root@localhost docker-compose-1.21.2]# python setup
Sh Using /usr/lib/python2.7/site-packages/ idna-2.5-py2.3. egg Searching for chardet==3.0.2 Best match: Egg chardet 3.0.2 is already the active version in easy-install.pth Installing Chardetect script to /usr/bin Using /usr/lib/python2.7/site-packages/chardet-3.0.2-py2.7.egg Finished Processing dependencies for docker-compose==1.21.2 ' 'Copy the code
4. Establish a soft connection
[root@localhost bin]# ln -s /usr/bin/docker-compose /usr/local/bin/docker-compose
Copy the code
5. Verify
[root@localhost bin]# docker-compose -versionDocker-compose version 1.21.2, build e7de1BCCopy the code
Third, other
How to install the Python installation module through setup.py
- Accessing the installation directory
python setup.py build
python setup.py install
Other installation methods failed. Procedure
1. Use binary files for installation
/usr/local/bin: can’t execute this binary.
2. Use deP for installation
Docker-compose :/usr/bin/python3 :/usr/bin/python3 :/usr/bin/python3 :/usr/bin/python3 :/usr/bin/python3 :/usr/bin/python3 :/usr/bin/python3 :/usr/bin/python3 :/usr/bin/python3 :/usr/bin/python3 :/usr/bin/python3 :/usr/bin/python3
3. Make the installation
The configuration file for liunx is not available./configuration is not available