Files
kamal/lib/mrsk/commands/builder/multiarch.rb
David Heinemeier Hansson a16e5ce886 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.
2023-01-22 10:47:22 +01:00

34 lines
650 B
Ruby

require "mrsk/commands/builder/base"
class Mrsk::Commands::Builder::Multiarch < Mrsk::Commands::Builder::Base
def create
docker :buildx, :create, "--use", "--name", builder_name
end
def remove
docker :buildx, :rm, builder_name
end
def push
docker :buildx, :build,
"--push",
"--platform", "linux/amd64,linux/arm64",
"--builder", builder_name,
"-t", config.absolute_image,
*build_args,
*build_secrets,
"."
end
def info
combine \
docker(:context, :ls),
docker(:buildx, :ls)
end
private
def builder_name
"mrsk-#{config.service}-multiarch"
end
end