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

@@ -17,6 +17,7 @@ class Mrsk::Commands::Builder::Native::Remote < Mrsk::Commands::Builder::Native
docker :buildx, :build,
"--push",
"--platform", platform,
"--builder", builder_name,
"-t", config.absolute_image,
*build_args,
*build_secrets,
@@ -40,7 +41,7 @@ class Mrsk::Commands::Builder::Native::Remote < Mrsk::Commands::Builder::Native
end
def builder_name
"mrsk-#{config.service}"
"mrsk-#{config.service}-native-remote"
end
def builder_name_with_arch
@@ -61,8 +62,7 @@ class Mrsk::Commands::Builder::Native::Remote < Mrsk::Commands::Builder::Native
end
def create_buildx
docker :buildx, :create,
"--use", "--name", builder_name, builder_name_with_arch, "--platform", platform
docker :buildx, :create, "--name", builder_name, builder_name_with_arch, "--platform", platform
end
def remove_buildx