Prune all unused images matching time filter
This commit is contained in:
@@ -6,7 +6,7 @@ class Mrsk::Commands::Prune < Mrsk::Commands::Base
|
|||||||
PRUNE_CONTAINERS_AFTER = 3.days.in_hours.to_i
|
PRUNE_CONTAINERS_AFTER = 3.days.in_hours.to_i
|
||||||
|
|
||||||
def images
|
def images
|
||||||
docker :image, :prune, "--force", "--filter", "until=#{PRUNE_IMAGES_AFTER}h"
|
docker :image, :prune, "--all", "--force", "--filter", "until=#{PRUNE_IMAGES_AFTER}h"
|
||||||
end
|
end
|
||||||
|
|
||||||
def containers
|
def containers
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ class CommandsPruneTest < ActiveSupport::TestCase
|
|||||||
|
|
||||||
test "images" do
|
test "images" do
|
||||||
assert_equal \
|
assert_equal \
|
||||||
"docker image prune --force --filter until=168h",
|
"docker image prune --all --force --filter until=168h",
|
||||||
new_command.images.join(" ")
|
new_command.images.join(" ")
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user