在网上找了好几种安装方法,有curl -L 的,下载失败。有pip安装的,这种前提需要安装python。对于这两种方法都不是很满意,于是决定先将docker-compose 从github下载下来,然后在服务器上移动到bin目录,设置可执行文件即可。我的系统是centos 7 x86_64。下面是安装docker compose的详细步骤。
这是docker-compose 官方仓库
https://github.com/docker/compose/releases
选择对应的平台和版本下载。
docker-compose版本 v2.20.3
checksums.txt 1.03 KB last week
docker-compose-darwin-aarch64 55.5 MB last week
docker-compose-darwin-aarch64.sha256 96 Bytes last week
docker-compose-darwin-x86_64 56.9 MB last week
docker-compose-darwin-x86_64.sha256 95 Bytes last week
docker-compose-linux-aarch64 55.1 MB last week
docker-compose-linux-aarch64.sha256 95 Bytes last week
docker-compose-linux-armv6 53.9 MB last week
docker-compose-linux-armv6.sha25693 Bytes last week
docker-compose-linux-armv7 53.9 MB last week
docker-compose-linux-x86_64
docker-compose-windows-x86_64.exe
Source code (zip) last week
Source code (tar.gz)
....
查看服务器指令架构
[root@localhost app]# uname -m
x86_64
我服务器是centos7 x86_64。 所以选择docker-compose-linux-x86_64
下载。
https://github.com/docker/compose/releases/download/v2.20.3/docker-compose-linux-x86_64
FTP工具上传到服务器,这里就不演示了。上传到 /
根目录下
# 移动到bin目录下
mv /docker-compose-linux-x86_64 /usr/local/bin/docker-compose
# 设置可执行权限
chmod +x /usr/local/bin/docker-compose
[root@localhost app]# docker-compose version
Docker Compose version v2.20.3
出现上面的版本就代表安装成功了。