云服务器CentOS 7 安装 docker-compose
1、运行此命令下载Docker Compose的当前稳定版本:sudo curl -L "https://github.com/docker/compose/releases/download/1.29.2/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
2、给与docker compose执行权限
sudo chmod +x /usr/local/bin/docker-compose
3、创建连接,指向 /usr/bin
sudo ln -s /usr/local/bin/docker-compose /usr/bin/docker-compose
4、测试安装结果
$ docker-compose --versiondocker-compose version 1.29.2, build 5becea4c
如果出现 docker-compose: error while loading shared libraries: libz.so.1: failed to map segment from shared object: Operation not permitted 错误,执行:
mkdir $HOME/tmpexport TMPDIR=$HOME/tmp
为方便起见,创建目录后,可以将“export”语句放在shell 的配置文件中(例如:~/.bash_profile 或~/.bashrc)
alias docker-compose='TMPDIR=${HOME}/tmp docker-compose'
页:
[1]