自动获取最新的docker compose版本号
This commit is contained in:
		| @@ -5,6 +5,12 @@ PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin | |||||||
| export PATH | export PATH | ||||||
|  |  | ||||||
|  |  | ||||||
|  | # step 0: prepare | ||||||
|  |  | ||||||
|  | github_project="docker/compose" | ||||||
|  | tag=$(wget -qO- -t1 -T2 "https://api.github.com/repos/${github_project}/releases/latest" | grep "tag_name" | head -n 1 | awk -F ":" '{print $2}' | sed 's/\"//g;s/,//g;s/ //g') | ||||||
|  |  | ||||||
|  |  | ||||||
| # step 1: install | # step 1: install | ||||||
| echo "net.core.default_qdisc=fq" >> /etc/sysctl.conf   #修改系统变量 | echo "net.core.default_qdisc=fq" >> /etc/sysctl.conf   #修改系统变量 | ||||||
| echo "net.ipv4.tcp_congestion_control=bbr" >> /etc/sysctl.conf   #修改系统变量 | echo "net.ipv4.tcp_congestion_control=bbr" >> /etc/sysctl.conf   #修改系统变量 | ||||||
| @@ -13,7 +19,7 @@ sysctl net.ipv4.tcp_available_congestion_control   #执行 | |||||||
|  |  | ||||||
| apt -y install sudo wget curl ufw screen vim git python3-pip | apt -y install sudo wget curl ufw screen vim git python3-pip | ||||||
| curl -fsSL https://get.docker.com | bash -s docker >${PWD}/step1 2>&1 | curl -fsSL https://get.docker.com | bash -s docker >${PWD}/step1 2>&1 | ||||||
| curl -L https://github.com/docker/compose/releases/download/v2.12.2/docker-compose-`uname -s`-`uname -m` -o /usr/local/bin/docker-compose && chmod +x /usr/local/bin/docker-compose | curl -L https://github.com/docker/compose/releases/download/${tag}/docker-compose-`uname -s`-`uname -m` -o /usr/local/bin/docker-compose && chmod +x /usr/local/bin/docker-compose | ||||||
| echo "step 1: install has finished" | echo "step 1: install has finished" | ||||||
|  |  | ||||||
|  |  | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user