Seed docker mirrors by pulling once per mirror first
Find the first registry mirror on each host. If we find any, pull the images on one host per mirror, then do the remainder concurrently. The initial pulls will seed the mirrors ensuring that we pull the image from Docker Hub once each. This works best if there is only one mirror on each host.
This commit is contained in:
@@ -122,6 +122,11 @@ class CliMainTest < CliTestCase
|
||||
.with(:docker, :buildx, :inspect, "kamal-app-multiarch", "> /dev/null")
|
||||
.returns("")
|
||||
|
||||
SSHKit::Backend::Abstract.any_instance.expects(:capture_with_info)
|
||||
.with(:docker, :info, "--format '{{index .RegistryConfig.Mirrors 0}}'")
|
||||
.returns("")
|
||||
.at_least_once
|
||||
|
||||
assert_raises(Kamal::Cli::LockError) do
|
||||
run_command("deploy")
|
||||
end
|
||||
@@ -155,6 +160,11 @@ class CliMainTest < CliTestCase
|
||||
.with(:docker, :buildx, :inspect, "kamal-app-multiarch", "> /dev/null")
|
||||
.returns("")
|
||||
|
||||
SSHKit::Backend::Abstract.any_instance.expects(:capture_with_info)
|
||||
.with(:docker, :info, "--format '{{index .RegistryConfig.Mirrors 0}}'")
|
||||
.returns("")
|
||||
.at_least_once
|
||||
|
||||
assert_raises(SSHKit::Runner::ExecuteError) do
|
||||
run_command("deploy")
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user