Class: Mrsk::Commands::Prune
Constant Summary
Constants inherited from Base
Base::DOCKER_HEALTH_LOG_FORMAT, Base::DOCKER_HEALTH_STATUS_FORMAT
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary collapse
Methods inherited from Base
#container_id_for, #initialize, #run_over_ssh
Constructor Details
This class inherits a constructor from Mrsk::Commands::Base
Instance Method Details
#containers(keep_last: 5) ⇒ Object
9 10 11 12 13 14 |
# File 'lib/mrsk/commands/prune.rb', line 9 def containers(keep_last: 5) pipe \ docker(:ps, "-q", "-a", "--filter", "label=service=#{config.service}", *stopped_containers_filters), "tail -n +#{keep_last + 1}", "while read container_id; do docker rm $container_id; done" end |
#images ⇒ Object
5 6 7 |
# File 'lib/mrsk/commands/prune.rb', line 5 def images docker :image, :prune, "--force", "--filter", "label=service=#{config.service}", "--filter", "dangling=true" end |