diff --git a/docker/default_task.sh b/docker/default_task.sh index da61c000..93050d47 100644 --- a/docker/default_task.sh +++ b/docker/default_task.sh @@ -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) diff --git a/docker/docker_entrypoint.sh b/docker/docker_entrypoint.sh index 9b818252..38e9900c 100644 --- a/docker/docker_entrypoint.sh +++ b/docker/docker_entrypoint.sh @@ -19,7 +19,7 @@ echo "########################################################################## ######################################获取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)