Rip out context_hosts checks

The remote host is now encoded in the builder name so we don't need
to check it. We'll just do an inspect to confirm the builder exists.
This commit is contained in:
Donal McBreen
2024-06-06 12:43:27 +01:00
committed by Donal McBreen
parent 2aeabda455
commit d6a5cf3c78
7 changed files with 34 additions and 106 deletions

View File

@@ -1,4 +1,3 @@
class Kamal::Commands::Builder::Base < Kamal::Commands::Base
class BuilderError < StandardError; end
@@ -14,10 +13,29 @@ class Kamal::Commands::Builder::Base < Kamal::Commands::Base
docker :image, :rm, "--force", config.absolute_image
end
def push
docker :buildx, :build,
"--push",
*platform_options,
"--builder", builder_name,
*build_options,
build_context
end
def pull
docker :pull, config.absolute_image
end
def info
combine \
docker(:context, :ls),
docker(:buildx, :ls)
end
def buildx_inspect
docker :buildx, :inspect, builder_name
end
def build_options
[ *build_tags, *build_cache, *build_labels, *build_args, *build_secrets, *build_dockerfile, *build_target, *build_ssh ]
end
@@ -35,14 +53,6 @@ class Kamal::Commands::Builder::Base < Kamal::Commands::Base
)
end
def context_hosts
:true
end
def config_context_hosts
[]
end
def first_mirror
docker(:info, "--format '{{index .RegistryConfig.Mirrors 0}}'")
end