6-2 compose-install-linux
curl -L https://github.com/docker/compose/releases/download/1.9.0/docker-compose-$(uname -s)-$(uname -m) > /usr/local/bin/docker-compose
uname -s
uname -m
ls -l /usr/local/bin/docker-compose
设置可执行
chmod a+x /usr/local/bin/docker-compose
查看版本
docker-compose --version
图示:
代码:
Xshell 5 (Build 0537)
Copyright (c) 2002-2014 NetSarang Computer, Inc. All rights reserved.
Type `help' to learn how to use Xshell prompt.
[c:\~]$
Connecting to 118.31.36.138:22...
Connection established.
To escape to local shell, press 'Ctrl+Alt+]'.
Welcome to Ubuntu 18.04.5 LTS (GNU/Linux 4.15.0-135-generic x86_64)
* Documentation: https://help.ubuntu.com
* Management: https://landscape.canonical.com
* Support: https://ubuntu.com/advantage
* Canonical Livepatch is available for installation.
- Reduce system reboots and improve kernel security. Activate at:
https://ubuntu.com/livepatch
New release '20.04.2 LTS' available.
Run 'do-release-upgrade' to upgrade to it.
Welcome to Alibaba Cloud Elastic Compute Service !
Last login: Thu Mar 25 18:22:12 2021 from 116.233.210.70
root@iZbp1berl2oy3e3vt5476fZ:~# curl -L https://github.com/docker/compose/releases/download/1.9.0/docker-compose-$(uname -s)-$(uname -m) > /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 798 0 --:--:-- --:--:-- --:--:-- 797
100 7857k 100 7857k 0 0 18859 0 0:07:06 0:07:06 --:--:-- 37921
root@iZbp1berl2oy3e3vt5476fZ:~# ls -l /usr/local/bin/docker-compose
-rw-r--r-- 1 root root 8045957 Mar 25 20:11 /usr/local/bin/docker-compose
root@iZbp1berl2oy3e3vt5476fZ:~# chmod a+x /usr/local/bin/docker-compose
root@iZbp1berl2oy3e3vt5476fZ:~# docker-compose --version
docker-compose version 1.9.0, build 2585387
root@iZbp1berl2oy3e3vt5476fZ:~#