改为检查latest tag
This commit is contained in:
@@ -8,7 +8,7 @@ npm install --prefix /scripts
|
|||||||
######################################获取docker构建文件里面的自定义信息方法-start#####################################################
|
######################################获取docker构建文件里面的自定义信息方法-start#####################################################
|
||||||
function getDockerImageLabel() {
|
function getDockerImageLabel() {
|
||||||
repo=akyakya/jd_scripts
|
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')
|
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)
|
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)
|
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)
|
||||||
|
@@ -19,7 +19,7 @@ echo "##########################################################################
|
|||||||
######################################获取docker构建文件里面的自定义信息方法-start#####################################################
|
######################################获取docker构建文件里面的自定义信息方法-start#####################################################
|
||||||
function getDockerImageLabel() {
|
function getDockerImageLabel() {
|
||||||
repo=akyakya/jd_scripts
|
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')
|
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)
|
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)
|
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)
|
||||||
|
Reference in New Issue
Block a user