Module: Dapp::Project::Command::Cleanup

Included in:
Dapp::Project
Defined in:
lib/dapp/project/command/cleanup.rb

Overview

Cleanup

Instance Method Summary collapse

Instance Method Details

#cleanupObject



8
9
10
11
12
13
14
15
16
17
18
19
20
# File 'lib/dapp/project/command/cleanup.rb', line 8

def cleanup
  lock("#{name}.images") do
    log_step_with_indent(name) do
      project_containers_flush
      project_dangling_images_flush
      remove_images_by_query([
        'docker images',
        %(--format '{{if ne "#{stage_cache}" .Repository }}{{.Repository}}:{{.Tag}}{{ end }}'),
        %(-f "label=dapp=#{stage_dapp_label}")
      ].join(' ')) # FIXME: negative filter is not currently supported by the Docker CLI
    end
  end
end