Move multiarch remote builder to hybrid builder

Include the host name in the builder name, so we can have one builder
per host/arch across all kamal projects.

Inherit from the remote builder. The difference in the hybrid builder
is that we create a local buildx instance and append the remote context
to it.
This commit is contained in:
Donal McBreen
2024-06-06 12:17:07 +01:00
committed by Donal McBreen
parent c048c097ed
commit 2aeabda455
4 changed files with 51 additions and 101 deletions

View File

@@ -17,7 +17,7 @@ class Kamal::Commands::Builder < Kamal::Commands::Base
when !config.builder.multiarch? && config.builder.cached?
local
when config.builder.local? && config.builder.remote?
multiarch_remote
hybrid
when config.builder.remote?
remote
else
@@ -33,8 +33,8 @@ class Kamal::Commands::Builder < Kamal::Commands::Base
@local ||= Kamal::Commands::Builder::Local.new(config)
end
def multiarch_remote
@multiarch_remote ||= Kamal::Commands::Builder::Multiarch::Remote.new(config)
def hybrid
@hybrid ||= Kamal::Commands::Builder::Hybrid.new(config)
end