Skip to content

Instantly share code, notes, and snippets.

@jagedn
Last active March 7, 2017 17:20
Show Gist options
  • Save jagedn/98d7e63a9fc19fbbd281d28147830e15 to your computer and use it in GitHub Desktop.
Save jagedn/98d7e63a9fc19fbbd281d28147830e15 to your computer and use it in GitHub Desktop.
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
}
@jagedn
Copy link
Author

jagedn commented Mar 7, 2017

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment