From c8f673ef7c9fdb98c5da2ead1d0159748a09df82 Mon Sep 17 00:00:00 2001 From: David Heinemeier Hansson Date: Thu, 2 Feb 2023 16:53:46 +0100 Subject: [PATCH] Add images command to see what's on the server for the service repository --- lib/mrsk/cli/app.rb | 5 +++++ lib/mrsk/commands/app.rb | 4 ++++ 2 files changed, 9 insertions(+) diff --git a/lib/mrsk/cli/app.rb b/lib/mrsk/cli/app.rb index 2f515011..f2116831 100644 --- a/lib/mrsk/cli/app.rb +++ b/lib/mrsk/cli/app.rb @@ -93,6 +93,11 @@ class Mrsk::Cli::App < Mrsk::Cli::Base on(MRSK.hosts) { |host| puts_by_host host, capture_with_info(*MRSK.app.list_containers) } end + desc "images", "List all the app images currently on servers" + def images + on(MRSK.hosts) { |host| puts_by_host host, capture_with_info(*MRSK.app.list_images) } + end + desc "current", "Return the current running container ID" def current on(MRSK.hosts) { |host| puts_by_host host, capture_with_info(*MRSK.app.current_container_id) } diff --git a/lib/mrsk/commands/app.rb b/lib/mrsk/commands/app.rb index db36c00a..7e17b0e9 100644 --- a/lib/mrsk/commands/app.rb +++ b/lib/mrsk/commands/app.rb @@ -85,6 +85,10 @@ class Mrsk::Commands::App < Mrsk::Commands::Base docker :container, :prune, "-f", *service_filter end + def list_images + docker :image, :ls, config.repository + end + def remove_images docker :image, :prune, "-a", "-f", *service_filter end