shell中下载最新版本或指定版本的办法(Dockerfile 中通用)

VER=$(curl -s https://api.github.com/repos/v2ray/v2ray-core/releases/latest | grep tag_name | cut -d '"' -f 4)
URL=$(curl -s https://api.github.com/repos/v2ray/v2ray-core/releases/tags/${VER} | jq .assets[0].browser_download_url | tr -d ")

需要安装curl jq 两个库

原文地址:https://www.cnblogs.com/jackadam/p/9867197.html