1
This commit is contained in:
@@ -238,9 +238,11 @@ pipeline {
|
||||
echo "发现 ${oldImages.size()} 个旧镜像需要清理"
|
||||
|
||||
oldImages.each { line ->
|
||||
def imageTag = line.split(' ')[0]
|
||||
echo "删除旧镜像: ${imageTag}"
|
||||
sh(returnStatus: true, script: "docker rmi -f \"${imageTag}\" || true")
|
||||
def parts = line.split(' ')
|
||||
def imageId = parts[0]
|
||||
def imageTag = parts[1]
|
||||
echo "删除旧镜像: ${imageTag} (ID: ${imageId})"
|
||||
sh "docker rmi -f \"${imageId}"\ || true"
|
||||
}
|
||||
|
||||
echo "清理完成,当前镜像状态:"
|
||||
|
||||
Reference in New Issue
Block a user