Create a context for local builds

This ensures we use the docker-container driver and not whatever the
local default is.
This commit is contained in:
Donal McBreen
2024-06-06 12:07:20 +01:00
parent 10a7645ab8
commit 5d8e4dee13

View File

@@ -1,8 +1,10 @@
class Kamal::Commands::Builder::Local < Kamal::Commands::Builder::Base
def create
docker :buildx, :create, "--name", builder_name, "--driver=docker-container"
end
def remove
docker :buildx, :rm, builder_name
end
def info
@@ -20,6 +22,10 @@ class Kamal::Commands::Builder::Local < Kamal::Commands::Builder::Base
build_context
end
def context_hosts
docker :buildx, :inspect, builder_name, "> /dev/null"
end
private
def builder_name
"kamal-local"