From 5d8e4dee13c465d77fba998630e0183d3c8dca52 Mon Sep 17 00:00:00 2001 From: Donal McBreen Date: Thu, 6 Jun 2024 12:07:20 +0100 Subject: [PATCH] Create a context for local builds This ensures we use the docker-container driver and not whatever the local default is. --- lib/kamal/commands/builder/local.rb | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lib/kamal/commands/builder/local.rb b/lib/kamal/commands/builder/local.rb index b404dd16..7af8bc06 100644 --- a/lib/kamal/commands/builder/local.rb +++ b/lib/kamal/commands/builder/local.rb @@ -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"