This commit is contained in:
dxin
2025-11-01 14:50:29 +08:00
parent 4053c70dcc
commit 1df8723f48
8 changed files with 34 additions and 23 deletions

View File

@@ -183,10 +183,12 @@ pipeline {
def imageId = parts[0]
def tag = parts[1]
// 跳过 latest
if (tag != "latest") {
if (tag == "<none>") {
echo "删除旧镜像(无标签): ${imageId}"
sh(returnStatus: true, script: "docker rmi -f ${imageId}")
} else if (tag != "latest") {
echo "删除旧镜像: ${imagePrefix}:${tag}"
sh "docker rmi -f ${imagePrefix}:${tag} || true"
sh(returnStatus: true, script: "docker rmi -f ${imagePrefix}:${tag}")
}
}
} else {