Use class specific buildx instances

So we don't have to muck with the machine default, and can swap between configurations without tearing down the old builder.
This commit is contained in:
David Heinemeier Hansson
2023-01-22 10:47:22 +01:00
parent e783950825
commit a16e5ce886
4 changed files with 15 additions and 15 deletions

View File

@@ -15,8 +15,16 @@ class Mrsk::Commands::Builder::Multiarch::Remote < Mrsk::Commands::Builder::Mult
end
private
def builder_name
super + "-remote"
end
def builder_name_with_arch(arch)
"#{builder_name}-#{arch}"
end
def create_local_buildx
docker :buildx, :create, "--use", "--name", builder_name, builder_name_with_arch(local["arch"]), "--platform", "linux/#{local["arch"]}"
docker :buildx, :create, "--name", builder_name, builder_name_with_arch(local["arch"]), "--platform", "linux/#{local["arch"]}"
end
def append_remote_buildx
@@ -50,9 +58,4 @@ class Mrsk::Commands::Builder::Multiarch::Remote < Mrsk::Commands::Builder::Mult
def remote
config.builder["remote"]
end
private
def builder_name_with_arch(arch)
"#{builder_name}-#{arch}"
end
end