改为检查latest tag

This commit is contained in:
iouAkira
2020-12-11 16:59:42 +08:00
parent 95d4c823fc
commit 20a9070a71
2 changed files with 2 additions and 2 deletions

View File

@ -8,7 +8,7 @@ npm install --prefix /scripts
######################################获取docker构建文件里面的自定义信息方法-start#####################################################
function getDockerImageLabel() {
repo=akyakya/jd_scripts
imageTag=dev
imageTag=latest
token=$(curl -s "https://auth.docker.io/token?service=registry.docker.io&scope=repository:${repo}:pull" | jq -r '.token')
digest=$(curl -s -H "Accept: application/vnd.docker.distribution.manifest.v2+json" -H "Authorization: Bearer $token" "https://registry-1.docker.io/v2/${repo}/manifests/${imageTag}" | jq .config.digest -r)
labels=$(curl -s -L -H "Accept: application/vnd.docker.distribution.manifest.v2+json" -H "Authorization: Bearer $token" "https://registry-1.docker.io/v2/${repo}/blobs/$digest" | jq .config.Labels)