Cyber Coding Course

師其意,不泥其跡

用bash更新docker-compse版本

安裝最新版本的docker-compose
我有調整過了,可在MacOS上執行
#!/bin/bash
compose_version=$(curl -s https://api.github.com/repos/docker/compose/releases/latest|grep tag_name|cut -d: -f 2|sed 's/["|,]//g'|sed -e 's/^[[:space:]]*//')
output='/usr/local/bin/docker-compose'
#echo "curl -sL https://github.com/docker/compose/releases/download/$compose_version/docker-compose-$(uname -s)-$(uname -m) -o $output"
curl -sL https://github.com/docker/compose/releases/download/$compose_version/docker-compose-$(uname -s)-$(uname -m) -o $output
chmod +x $output
echo $(docker-compose --version)
如果是用Raspberry,請直接安裝舊版本的,目前沒有relase arm的版本
sudo apt install docker-compose

作者: Devin Yang