+
This commit is contained in:
@@ -164,10 +164,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 {
|
||||
|
||||
Reference in New Issue
Block a user