透過Github API 取得目前發行版本,自動建立Docker Container

VERSION=$(
 curl --silent "https://api.github.com/repos/goodwithtech/dockle/releases/latest" | \
 grep '"tag_name":' | \
 sed -E 's/.*"v([^"]+)".*/\1/' \
)


echo ${VERSION}

# docker run --rm -v /var/run/docker.sock:/var/run/docker.sock \
# goodwithtech/dockle:v${VERSION} test-image:v1