Class: Shippy::Cli::Prune

Inherits:
Base
  • Object
show all
Defined in:
lib/shippy/cli/prune.rb

Instance Method Summary collapse

Methods inherited from Base

exit_on_failure?, #initialize

Constructor Details

This class inherits a constructor from Shippy::Cli::Base

Instance Method Details

#allObject



3
4
5
6
# File 'lib/shippy/cli/prune.rb', line 3

def all
  containers
  images
end

#containersObject



16
17
18
19
20
# File 'lib/shippy/cli/prune.rb', line 16

def containers
  on(SHIPPY.host) do
    execute :docker, :container, :prune, "--force", "--filter", "until=#{3.days.in_hours}h"
  end
end

#imagesObject



9
10
11
12
13
# File 'lib/shippy/cli/prune.rb', line 9

def images
  on(SHIPPY.host) do
    execute :docker, :image, :prune, "--all", "--force", "--filter", "until=#{7.days.in_hours}h"
  end
end