Use local docker registry to push and pull app images

This commit is contained in:
T. R. Bernstein
2025-08-29 16:55:50 +02:00
parent 18f1bbbeac
commit 95cbc62ef1
24 changed files with 352 additions and 64 deletions

View File

@@ -228,7 +228,11 @@ class CommandsBuilderTest < ActiveSupport::TestCase
private
def new_builder_command(additional_config = {})
Kamal::Commands::Builder.new(Kamal::Configuration.new(@config.deep_merge(additional_config), version: "123"))
Kamal::Configuration.new(@config.deep_merge(additional_config), version: "123").then do |config|
KAMAL.reset
KAMAL.stubs(:config).returns(config)
Kamal::Commands::Builder.new(config)
end
end
def local_arch

View File

@@ -85,6 +85,15 @@ class CommandsRegistryTest < ActiveSupport::TestCase
registry.logout(registry_config: accessory_registry_config).join(" ")
end
test "registry setup" do
@config[:registry] = { "server" => "localhost:5000" }
assert_equal "docker start kamal-docker-registry || docker run --detach -p 127.0.0.1:5000:5000 --name kamal-docker-registry registry:3", registry.setup.join(" ")
end
test "registry remove" do
assert_equal "docker stop kamal-docker-registry && docker rm kamal-docker-registry", registry.remove.join(" ")
end
private
def registry
Kamal::Commands::Registry.new main_config