Build and clean remote builders correctly

Check that the builder and context match what we expect, and if not
remove and re-create them.
This commit is contained in:
Donal McBreen
2024-09-02 15:10:39 +01:00
parent d7e785cd36
commit e557eea79c
12 changed files with 101 additions and 23 deletions

View File

@@ -32,7 +32,7 @@ class Kamal::Commands::Builder::Base < Kamal::Commands::Base
docker(:buildx, :ls)
end
def buildx_inspect
def inspect_builder
docker :buildx, :inspect, builder_name unless docker_driver?
end
@@ -101,10 +101,6 @@ class Kamal::Commands::Builder::Base < Kamal::Commands::Base
config.builder
end
def context_host(builder_name)
docker :context, :inspect, builder_name, "--format", ENDPOINT_DOCKER_HOST_INSPECT
end
def platform_options(arches)
argumentize "--platform", arches.map { |arch| "linux/#{arch}" }.join(",") if arches.any?
end