Remove images of the same name before pulling a new one

Or you'll end up with untagged dupes.
This commit is contained in:
David Heinemeier Hansson
2023-02-20 18:06:16 +01:00
parent 9d6ccf9889
commit 42b343436d
4 changed files with 21 additions and 1 deletions

15
test/cli/build_test.rb Normal file
View File

@@ -0,0 +1,15 @@
require_relative "cli_test_case"
class CliBuildTest < CliTestCase
test "pull" do
run_command("pull").tap do |output|
assert_match /docker image rm --force dhh\/app:999/, output
assert_match /docker pull dhh\/app:999/, output
end
end
private
def run_command(*command)
stdouted { Mrsk::Cli::Build.start([*command, "-c", "test/fixtures/deploy_with_accessories.yml"]) }
end
end