Skip to content

Instantly share code, notes, and snippets.

@ssig33
Created August 9, 2015 06:00
Show Gist options
  • Save ssig33/0e67e3254699f7b923a5 to your computer and use it in GitHub Desktop.
Save ssig33/0e67e3254699f7b923a5 to your computer and use it in GitHub Desktop.
#!/usr/bin/env ruby
ary = `sudo docker ps -a -q`.split("\n")
ary.each_with_index{|x,i|
system "sudo docker rm #{x}"
puts "#{i+1} / #{ary.count}"
}
ary = `sudo docker images | awk '/^<none>/ { print $3 }'`.split("\n")
ary.each_with_index{|x,i|
system "sudo docker rmi #{x}"
puts "#{i+1} / #{ary.count}"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment