Last active
March 7, 2017 17:20
-
-
Save jagedn/98d7e63a9fc19fbbd281d28147830e15 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def p = ["docker","images"].execute() | ["sort","-buk1,3"].execute() | |
p.waitFor() | |
def text =p.text | |
def prev | |
text.split('\n').each{ line -> | |
def fields = line.split(' ').findAll{ it.size() } | |
if(!prev || prev[0] != fields[0]) | |
println fields[0] | |
if(prev && prev[2] != fields[2]) | |
println "\t${fields[1]}\t${fields[2]}" | |
prev = fields | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Lista las imagenes de docker agrupandolas por el nombre de la imagen y filtrando IDs repetidos (misma imagen con diferentes tags)
util para cuando necesitas hacer limpieza selectiva de imagenes antiguas